KimybaWoW


Saturday, 2024-04-20, 3:24 PM


Welcome Peon | RSS


Main | How to make a Teleport Item with a LUA file ( the easy way ) - Forum | Registration | Login
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » Server Guides » Guides » How to make a Teleport Item with a LUA file ( the easy way )
How to make a Teleport Item with a LUA file ( the easy way )
kimybawowDate: Wednesday, 2008-10-15, 11:42 AM | Message # 1
Server Owner
Group: Administrators
Messages: 26
Reputation: 15
Status: Offline
Hello everyone

My Nick is Kim and im working on the private server KimybaWoW
I'm the starter of this server, and i was bored, so i changed some stuff in some LUA files and Woopsi, it actually worked, i want to share this with all of you so you can use it on your own server

Quote
function Item_Trigger(item, event, player)
item:GossipCreateMenu(100, player, 0)
item:GossipMenuAddItem(0,"Name of Head Menu", 0, 0)
item:GossipSendMenu(player)
end

function Gossip_Submenus(item, event, player, id, intid, code)
if(intid == 0) then
item:GossipCreateMenu(101, player, 0)
item:GossipMenuAddItem(0,"Location 1", 50, 0)
item:GossipMenuAddItem(0,"Location 2", 51, 0)
item:GossipMenuAddItem(0,"Location 3", 52, 0)
item:GossipMenuAddItem(0,"Location 4", 53, 0)
item:GossipMenuAddItem(0,"Location 5", 54, 0)
item:GossipMenuAddItem(0,"Location 6", 55, 0)
item:GossipSendMenu(player)
end
if(intid == 50) then
player:Teleport(Map ID of Location 1, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
if(intid == 51) then
player:Teleport(Map ID of Location 2, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
if(intid == 52) then
player:Teleport(Map ID of Location 3, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
if(intid == 53) then
player:Teleport(Map ID of Location 4, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
if(intid == 54) then
player:Teleport(Map ID of Location 5, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
if(intid == 55) then
player:Teleport(Map ID of Location 6, X-Coordinates , Y-Coordinates, Z-Coordinates)
end
end

RegisterItemGossipEvent(Item ENTRY ID, 1, "Item_Trigger")
RegisterItemGossipEvent(Item ENTRY ID, 2, "Gossip_Submenus")

As you see i've made it very easy for you, just open a new notepad copy this into it change what you need to change and then go to file, save as then write: whatevername.lua
then just under here you see Textfile(.txt) and then an arrow pointing down click that and then choose all files, then save it where you want.

Quote
function Gossip_Submenus(item, event, player, id, intid, code)
if(intid == 0) then
item:GossipCreateMenu(101, player, 0)
item:GossipMenuAddItem(0,"Location 1", 50, 0)
item:GossipMenuAddItem(0,"Location 2", 51, 0)
item:GossipMenuAddItem(0,"Location 3", 52, 0)
item:GossipMenuAddItem(0,"Location 4", 53, 0)
item:GossipMenuAddItem(0,"Location 5", 54, 0)
item:GossipMenuAddItem(0,"Location 6", 55, 0)
item:GossipSendMenu(player)
end

As you see there are 6 location, you can add more or remove some just copy one of the rows

Quote
item:GossipMenuAddItem(0,"Location 6", 55, 0)

Change 55 to another number which is not used of the other 6 locations. When this is done..

Quote
if(intid == 55) then
player:Teleport(Map ID of Location 6, X-Coordinates , Y-Coordinates, Z-Coordinates)
end

Change if(intid == 55 to the number you chose before and then change the map id and X, Y and Z coordinates to where you want it to port.

For the Item ID i recommend you to use this ID 28452 that item is already in the database and you can't use it while running, so thats good.

After you have saved the file as a LUA file go to the file where you save it right click it and click Preferences and check up that it is a LUA-File if it is go to your server folder find the folder "Scripts" and drop the file in there.
Restart server and log in.

I hope this helped you (: Oh and by the way, i could use some rep biggrin

Kim


 
Forum » Server Guides » Guides » How to make a Teleport Item with a LUA file ( the easy way )
  • Page 1 of 1
  • 1
Search:


Copyright MyCorp © 2024   Powered by uCoz