• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

check vocation on grass

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
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
 
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

Code:
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

Add this moveevent to every grass tile. Just change the text to whatever you like and the position to get teleported back.
 
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.
 
Well thats not what was specified on the request. If you want a single or couple tiles just give then an unique id. The script is exactly the same as I posted, just the moveevents.xml should be different...

Code:
    <movevent event="StepIn" uniqueid="xxxx" script="xxxx.lua"/>
 
Last edited:
Use action ID if you want to have more than 1 tiles with that script. With unique ID you can only set it to single one (Or copy paste the script for every unique id you have)
 
Add this to your walkback.lua
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
and register it of course
Lua:
    <movevent event="StepIn" actionid="123" script="walkback.lua"/>
 
Back
Top