• 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 [TFS 1.3] Pause a function

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
829
Solutions
123
Reaction score
655
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