[DiscordArchive] What changed?
[DiscordArchive] What changed?
Archived author: Revision • Posted: 2022-08-03T14:35:47.507000+00:00
Original source
What changed?
Archived author: buggedout • Posted: 2022-08-03T14:35:48.045000+00:00
Original source
now i can finally dissect that code and hopefully learn something ^^
Archived author: buggedout • Posted: 2022-08-03T14:36:32.948000+00:00
Original source
I reverted to original script, fixing intid and addring prints....thats when i said no dice
Archived author: buggedout • Posted: 2022-08-03T14:36:51.832000+00:00
Original source
then i dropped in your snipped (with elseif) and voila, item added!
Archived author: Revision • Posted: 2022-08-03T14:37:18.214000+00:00
Original source
Was multiple OnGossipSelects the issue then?
Archived author: Foe • Posted: 2022-08-03T14:38:34.443000+00:00
Original source
```Lua
--Item that designates that character is a hardcore character.
local hardCoreItem = 90000
--NPC id
local hcNPC = 90000
--This is how long the character is locked for - default is 32 years.
local banTimer = 999999999
--on death function - checks if player has token and bans character if it does.
local function PlayerDeath(event, killer, killed)
if(killed:HasItem(hardCoreItem, 1)) then
print(killed:GetName() .. " was killed by " .. killer:GetName())
SendWorldMessage(killed:GetName() .. " was killed by " .. killer:GetName())
Ban(1, killed:GetName(), banTimer)
end
end
--First Gossip Screen for NPC
local function OnFirstTalk(event, player, unit)
player:GossipMenuAddItem(0, "Looking for a challenge??? Click here to try hardcore mode!", 0, 1, true, "Just making sure that you want to turn on hardcore mode?? This will lock the character after death and you will no longer be able to play the character!!!")
player:GossipSendMenu(1, unit)
end
--Selection for NPC gossip
local function OnSelect(event, player, unit, sender, intid, code)
if (intid == 1) then
player:AddItem(hardCoreItem, 1)
end
end
RegisterCreatureGossipEvent(hcNPC, 1, OnFirstTalk)
RegisterCreatureGossipEvent(hcNPC, 2, OnSelect)
RegisterPlayerEvent(8, PlayerDeath)
```
Archived author: Foe • Posted: 2022-08-03T14:38:37.618000+00:00
Original source
There you go
Archived author: buggedout • Posted: 2022-08-03T14:39:49.930000+00:00
Original source
I guess, the right event was never triggered with IF, but with your cleaner code and elseif it works like a charm
Archived author: Foe • Posted: 2022-08-03T14:40:16.236000+00:00
Original source
Try what I posted above, that gives you a nice popup instead of submenus
Archived author: buggedout • Posted: 2022-08-03T14:40:50.898000+00:00
Original source
il give it a go too, more options is never a bad thing