• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [TFS 1.3] Pause a function

Apollos

Dude who does stuff
Premium User
Joined
Apr 22, 2009
Messages
845
Solutions
123
Reaction score
690
Location
United States
Just working on a slot machine that slows down as it goes, seen someone do it before. Still got a lot to test through but mainly having a issue with a created function. How would I do this without freezing the server. Was thinking maybe addEvent to recursively call function again but I'm not sure if that's the right way either.

LUA:
local function pause(extraTime)
    newTime = os.time() + extraTime
    while os.time() < newTime do
        --nothing
    end
end
 
Solution
just use addEvent to execute the code you want to, there's no need (or way) to pause a function without stopping the execution of everything else
just use addEvent to execute the code you want to, there's no need (or way) to pause a function without stopping the execution of everything else
 
Solution
Back
Top