• 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 Script repeat every second

Kahras

Member
Joined
Aug 6, 2012
Messages
101
Reaction score
7
Location
Warsaw
Lua:
addEvent(function()
 if player:getStorageValue(76767) == Number then
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
end, 1000)

how to make the script repeat every second until the if condition is met?
 
Lua:
local function loop(cid)
    if getPlayerStorageValue(cid, storage) == value then
        return
    end
  
    addEvent(loop, 1000, cid)
end

You need to call the function at some point
 
Back
Top