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

TFS 1.2 wait x seconds to logout

Manigold

Active Member
Joined
Nov 2, 2017
Messages
199
Solutions
8
Reaction score
49
I'd like to make people wait for example five seconds, to logout after login .
Can someone help me with this?
 
Solution
<event type="logout" name="testlogout" script="others/testlogout.lua" />

Lua:
function onLogout(player)
    if player:getStorageValue(111111) <= os.time() then
        player:setStorageValue(111111, os.time() + 5) -- 5 seconds
    else 
        player:sendCancelMessage("Please wait five seconds to logout again.")
        return false
    end
    return true
end
<event type="logout" name="testlogout" script="others/testlogout.lua" />

Lua:
function onLogout(player)
    if player:getStorageValue(111111) <= os.time() then
        player:setStorageValue(111111, os.time() + 5) -- 5 seconds
    else 
        player:sendCancelMessage("Please wait five seconds to logout again.")
        return false
    end
    return true
end
 
Solution
Back
Top