hey, i need scripts for tfs 1.x
to if someone move to grass id xxxx, on position
32,32
31,32
30,32 etc
and vocation == 0
then got message please come back when you chose vocation.
if vocation > 0
then
can go
function onStepIn(cid, pos)
if isPlayer(cid) then
newPos = {x=1663, y=2552, z=4}
if vocation == 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't get past this point yet!")
doTeleportThing(cid, newPos)
else
return false
end
end
return true
end
yea i agree, can you give example code?Better add simple action id to the tile youre working on and execute script only on that thing instead of doing it on every grass-tile with that id on the whole map, its really inefficient.
<movevent event="StepIn" uniqueid="xxxx" script="xxxx.lua"/>
if item:getActionId() == 123 then
if creature:isPlayer() and creature:getVocation():getId() == 0 then
creature:teleportTo(fromPosition, false)
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Please, come back when you chose vocation.")
end
end
<movevent event="StepIn" actionid="123" script="walkback.lua"/>