Code:
local timer = 8000
----------------------------------------------------------
--Triggers
function wp1_Trigger(item, event, player)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
else
player:RegisterEvent("wp1_teleport", timer, 0)
player:SendAreaTriggerMessage("You will be teleported in 8 seconds.")
end
end
function wp2_Trigger(item, event, player)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
else
player:RegisterEvent("wp2_teleport", timer, 0)
player:SendAreaTriggerMessage("You will be teleported in 8 seconds.")
end
end
function wp3_Trigger(item, event, player)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
else
player:RegisterEvent("wp3_teleport", timer, 0)
player:SendAreaTriggerMessage("You will be teleported in 8 seconds.")
end
end
----------------------------------------------------------
-- Teleport Coords
function wp1_teleport(item, event, player)
player:Teleport(0, 3525.3037, -2236.634, 145.8)
end
function wp2_teleport(item, event, player)
player:Teleport(0, 3468.8491, -2172.736, 148.8)
end
function wp3_teleport(item, event, player)
player:Teleport(0, 3306.4931, -2164.7663, 139.8)
end
RegisterItemGossipEvent(96909,1,"wp1_Trigger")
RegisterItemGossipEvent(96910,1,"wp2_Trigger")
RegisterItemGossipEvent(96911,1,"wp3_Trigger")
Right so this script is registered for THREE items.
So when i click the item the script should send a message and count down 8 seconds and then teleport the player.
But the problem is the message appears but the player does not get teleported.
What is wrong ?