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

Exhaustion by ms

Xagul

deathzot.net
Joined
Jun 30, 2008
Messages
1,295
Solutions
3
Reaction score
1,043
I was just wondering if anyone knew a way to make an exhaust function that deals in ms. I would like it to be something like this:

Code:
exhaust = 5000ms

if exhaust then
 --you are currently exhausted.
else
 --script
end
 
should be something like this:
Code:
local exhaust = 5000 -- 5000 ms (5 seconds i guess)
local storage = 2323
if getPlayerStorageValue(cid, storage) >= (os.time() / 1000) then
	...
else
	doPlayerSetStorageValue(cid, storage, os.time() + exhaust)
end
 
via TFS exhaustion functions:
Code:
            local exhaust = 15020
            local seconds = 5*0.010 --5 miliseconds

            if exhaustion.check(cid, exhaust) then
                return doPlayerSendCancel(cid, 'You are currently exhausted['..exhaustion.get(cid, exhaust)..'].')
            else
                exhaustion.set(cid, exhaust, seconds)
            end
 

Similar threads

Back
Top