• 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!

Lua StepIn animation (55) on x y z (only one)

Szafi

www.rookwar.pl
Joined
Mar 2, 2009
Messages
165
Reaction score
10
Location
Poland
How to make script on SS?

animacja_55.png

TFS 0.4, Tibia 8.60

@edit
where i found TFS lua documentation?
 
Last edited:
Give that ground an actionId or uniqueId.

onStepIn()
doSendMagicEffect({x, y, z}, 55, false) -- or true if you want
end

If you want the full script, post in Requests board.
 
Give that ground an actionId or uniqueId.

onStepIn()
doSendMagicEffect({x, y, z}, 55, false) -- or true if you want
end

If you want the full script, post in Requests board.
Okey, sorry.

I make this:

Code:
function onStepIn(cid.pos)
if isPlayer(cid) then
doSendMagicEffect({x=1091, y=1053, z=7}, 55, false)
end

Engine:
data/movements/scripts/strzalki_informujace.lua:1: ')' expected near '.'

What is wrong?
 
Open another onStepIn() script in Movements and copy the function onStepIn() line if you forget the parameters.
Using cid.pos there is incorrect.
 
replace the . with ,
Code:
function onStepIn(cid, pos)
if isPlayer(cid) then
doSendMagicEffect({x=1070, y=1047, z=7}, 55, false)
doSendMagicEffect({x=1071, y=1047, z=7}, 55, false)
end
end

Ok. How to block further execution of the script? Its looped, is to show what once.

@edit worked
 
Last edited:
Code:
function onStepIn(cid, pos)
if isPlayer(cid) then
doSendMagicEffect({x=1070, y=1047, z=7}, 55, false)
doSendMagicEffect({x=1071, y=1047, z=7}, 55, false)
end
end

Ok. How to block further execution of the script? Its looped, is to show what once.

@edit worked

You can use storage values to stop code from executing multiple times.
Code:
function onStepIn(cid, pos)
   if isPlayer(cid) then
     if getPlayerStorageValue(cid, 20002) == -1 then
       doSendMagicEffect({x=1070, y=1047, z=7}, 55, false)
       doSendMagicEffect({x=1071, y=1047, z=7}, 55, false)
       setPlayerStorageValue(cid, 20002, 1)
     else
       return false
     end
   end
   return true
end
 
You can use storage values to stop code from executing multiple times.
Code:
function onStepIn(cid, pos)
   if isPlayer(cid) then
     if getPlayerStorageValue(cid, 20002) == -1 then
       doSendMagicEffect({x=1070, y=1047, z=7}, 55, false)
       doSendMagicEffect({x=1071, y=1047, z=7}, 55, false)
       setPlayerStorageValue(cid, 20002, 1)
     else
       return false
     end
   end
   return true
end
but that will only stop it for 1 player and it will never make it start again for that player, although it should really check if an effect is active.. i'll be honest I don't feel like writing it hehe
Code:
local effectPos = {
    {x=1070, y=1047, z=7},
    {x=1071, y=1047, z=7}
}
local exhaust = true
local time_ = 30

function resetExhaust()
    exhaust = true
end

function onStepIn(cid, pos)
   if isPlayer(cid) then
     if exhaust then
        exhaust = false
        for i = 1, #effectPos do
            doSendMagicEffect(effectPos[i], 55, false)
        end
        addEvent(resetExhaust, time_ * 1000)
    end
    return true
end
 
Back
Top