Hi all, I'm new to .lua scripting and would like to know how to do something like this:
Create a script that allows a person to go through a portal and pick their vocation. I also need a script that allows a user to "use" it and become a specific vocation.
Any help would be great! My server stats: The Forgotten Server - Version 0.2.14
EDIT: I fixed a few things but it makes a clone of the person in the spot it teleports them to.
What causes this?
Current script:
function onStepIn(cid, item, position, fromPosition)
local toPos = {x = 1045, y = 1032, z = 7}
if getPlayerVocation(cid) > 0 then
doPlayerSetVocation(cid, 4)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"You are now a knight!")
doTeleportThing(cid, toPos)
{x = 1045, y = 1034, z = 7}
else
doPlayerSendCancel(cid, 'Sorry, you are currently not able to access this area.')
end
return true
end
Create a script that allows a person to go through a portal and pick their vocation. I also need a script that allows a user to "use" it and become a specific vocation.
Any help would be great! My server stats: The Forgotten Server - Version 0.2.14
EDIT: I fixed a few things but it makes a clone of the person in the spot it teleports them to.
What causes this?
Current script:
function onStepIn(cid, item, position, fromPosition)
local toPos = {x = 1045, y = 1032, z = 7}
if getPlayerVocation(cid) > 0 then
doPlayerSetVocation(cid, 4)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"You are now a knight!")
doTeleportThing(cid, toPos)
{x = 1045, y = 1034, z = 7}
else
doPlayerSendCancel(cid, 'Sorry, you are currently not able to access this area.')
end
return true
end
Last edited: