Code:
function Tele_OnTank(Unit, event, player)
first, you have to set what the npc will do when a player talks to him!
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
then you have to tell the script to create a menu for the player! like so!
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)
Now you have to add the "Item" or choice the player will see when he talks to your teleporter.
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreatreMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)[
Unit:GossipSendMenu(player)
Then you have to tell the script to send the menu to the player. like so.
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)
Unit:GossipSendMenu(player)
end
Code:
function Tele_OnSelect(Unit, event, player, intid, code)
Now you have to tell the script what will happen when the player chooses that option.
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)
Unit:GossipSendMenu(player)
end
function Tele_OnSelect(Unit, event, player, intid, code)
if(intid == 0) then
player:Teleport(530, -244.882614, 1032.869741, 54.321983, 1.583673)
end
now after you have set what the script will do when the player selects the option, then you have to set what will happen if the (Id) of his selection is true. Its the same thing as what will happen when he selects the option, you just telling the script to do it when he selects the gossip option.
Note:You can put whatever (X, Y, Z) you want by going in game and typing .gps
In this case its Hellfire.
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)
Unit:GossipSendMenu(player)
end
function Tele_OnSelect(Unit, event, player, intid, code)
if(intid == 0) then
player:Teleport(530, -244.882614, 1032.869741, 54.321983, 1.583673)
end
RegisterUnitGossipEvent(Npc Id, 1, "Tele_OnTalk")
RegisterUnitGossipEvent(Npc Id, 2, "Tele_OnSelect")
now you have to register the event in which the player is doing.
And your done here is the script we made
Code:
function Tele_OnTalk(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0,"Mall", 0, 0)
Unit:GossipSendMenu(player)
end
function Tele_OnSelect(Unit, event, player, intid, code)
if(intid == 0) then
player:Teleport(530, -244.882614, 1032.869741, 54.321983, 1.583673)
end
RegisterUnitGossipEvent(Npc Id, 1, "Tele_OnTalk")
RegisterUnitGossipEvent(Npc Id, 2, "Tele_OnSelect")
credits go to me
i dont know in what section i shud post this!