Guys, I've made two teleports..
Yes the teleport functions are in one document.
The problem now is, both teleports don't work.
I've referred it well (I guess) and the GUI isn't giving any errors so I can't figure out what the problem is.
Can you guys perhaps help me out a bit?
ALSO:
If I want to add the same script to another teleport should I use it this way?
I'm not sure though, kinda trying some things out hehe
Thanks in advance!
Lua:
-- Starter Teleporter
function onStepIn(cid, item, frompos, itemEx, topos)
local toStarter = {x=1020, y=1022, z=7}
local toEqroom = {x=1069, y=1022, z=7}
if getPlayerVocation(cid) < 1 then
local fromStarter = {x=1010, y=1016, z=7}
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING,"You don't have a vocation yet. Ask one of the NPCs to grant you a vocation.")
doTeleportThing(cid, toStarter)
doSendMagicEffect(toStarter, CONST_ME_TELEPORT)
doSendMagicEffect(fromStarter, CONST_ME_TELEPORT)
else local fromStarter = {x=10, y=1030, z=7}
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"So you've made your decision, pilgrim. Now it's time to get yourself some clothes.")
doTeleportThing(cid, toEqroom)
doSendMagicEffect(toEqroom, CONST_ME_TELEPORT)
doSendMagicEffect(fromStarter, CONST_ME_TELEPORT)
end
end
-- Test Teleporter
function onStepIn(cid, item, frompos, itemEx, topos)
local fromtest = {x=1020, y=1022, z=7}
local totest = {x= 1025, y=1022, z=7}
if getPlayerPosition(cid) == fromtest then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING,"YO! IT WORKS!")
doTeleportThing(cid, totest)
doSendmagicEffect(totest, CONST_ME_TELEPORT)
doSendMagicEffect(fromtest, CONST_ME_TELEPORT)
end
end
Yes the teleport functions are in one document.
The problem now is, both teleports don't work.
Code:
<movevent event="StepIn" itemid="1387" script="teleport.lua"/>
I've referred it well (I guess) and the GUI isn't giving any errors so I can't figure out what the problem is.
Can you guys perhaps help me out a bit?
ALSO:
If I want to add the same script to another teleport should I use it this way?
Lua:
-- Starter Teleporter
function onStepIn(cid, item, frompos, itemEx, topos)
local toStarter = {x=1020, y=1022, z=7}
local toEqroom = {x=1069, y=1022, z=7}
if getPlayerVocation(cid) < 1 then
local fromStarter = {x=1010, y=1016, z=7; x=1020, y=1016, z=7} -- I've edited right here
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING,"You don't have a vocation yet. Ask one of the NPCs to grant you a vocation.")
doTeleportThing(cid, toStarter)
doSendMagicEffect(toStarter, CONST_ME_TELEPORT)
doSendMagicEffect(fromStarter, CONST_ME_TELEPORT)
else local fromStarter = {x=10, y=1030, z=7}
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"So you've made your decision, pilgrim. Now it's time to get yourself some clothes.")
doTeleportThing(cid, toEqroom)
doSendMagicEffect(toEqroom, CONST_ME_TELEPORT)
doSendMagicEffect(fromStarter, CONST_ME_TELEPORT)
end
end
I'm not sure though, kinda trying some things out hehe
Thanks in advance!