Basics of what you need
1. A Custom Portal Added to the DB, with a Unique entry.
2. Basic knowledge of how to use the LUA script and how to add them to your server.
Lets Get Started
We're going to make a portal to the STV arena as the example.
Anytime you see a + in the code boxes, that mean that that line was added on that step. It won't be in your actual script, it's just there to help you keep track.
First off, open up a Blank Document ( I recommend notepad, as it doesn't add any custom headers or other junk to the file ).
Lets Create a Function we can use to make the Portal.
CODE
Code:
function STV_Arena(pGameObject, event, pMisc)
What we are doing here is creating a basic function. This won't do anything until we add more stuff to it, so moving on...
We need to add the script to move the player to the location, this is done by the pMisc:Teleport command.
CODE
Code:
function STV_Arena(pGameObject, event, pMisc)
+ pMisc:Teleport(0, -13232.7, 219.565, 31.9761)
+end
A breakdown of the pMisc:Teleport() command
pMisc:Teleport(mapid, x co-ord, y co-ord, z co-ord)
For the Gurubashi arena, the co-ords are as follows:
MapID: 0
X: -13232.7
Y:219.565
Z: 31.9761
This script still will not work, as we've not yet defined the GameObject Event to run the function, we'll do that now.
CODE
Code:
function STV_Arena(pGameObject, event, pMisc)
pMisc:Teleport(0, -13232.7, 219.565, 31.9761)
end
+RegisterGameObjectEvent(GO_ID, 2, "STV_Arena")
You must replace GO_ID with the portal ID in your DB ( SQL is at the bottom ).
What this does, is when the portal is clicked, tells the server to run the TELE_GURUBASHI function, or the teleport player function.
This script is now operational. Now save it as .LUA, such as ArenaTele.LUA and add it to the "scripts" folder on your server. If there is not a scripts folder, create one. Then add the GO to the game, and click on it!
Me, and my friend made this post.