SkatCh Posted November 3, 2014 Share Posted November 3, 2014 (edited) guys please i need some help i create a vip system and i want to keep the time working even if the player logout is that possible . just a part from my script: local timers = { } function startTime ( thePlayer ) if not ( timers [ thePlayer ] ) then timers [ thePlayer ] = setTimer ( function () if ( isElement ( thePlayer ) ) then local timeLeft = getElementData ( thePlayer, "time" ); if ( timeLeft ) then if ( timeLeft > 0 ) then if ( ( timeLeft - 1 ) > 0 ) then setElementData ( thePlayer, "time", timeLeft - 1 ); else remove ( thePlayer ); end else remove ( thePlayer ); end end else return; end end, 1000, -1 ); end end Edited November 3, 2014 by Guest Link to comment
Castillo Posted November 3, 2014 Share Posted November 3, 2014 Well, of course not, because 'thePlayer' will be destroyed once the player leaves the server, so setElementData will stop working. Link to comment
SkatCh Posted November 3, 2014 Author Share Posted November 3, 2014 i already make it with setAccountData/getAccountData . so what can i do to keep timer decreasing. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now