Jump to content

timer for setAccountData


fairyoggy

Recommended Posts

  • 2 weeks later...

@IIYAMA Can you give me example in code? I can’t understand how to use it correctly.

I could only get this but how can i use it in my goal ?

local time = getRealTime()
	local hours = time.hour
	local minutes = time.minute
	local seconds = time.second
	local duration = 10
	local endtime = seconds + duration
	local curtime = hours..":"..minutes..":"..seconds
	local remaintime = endtime - curtime
	

 

Link to comment
  • Moderators
4 hours ago, slapz0r said:

I could only get this but how can i use it in my goal ?

Use timestamp. Check the docs.

 

And no I currently can't give any examples as I am extremely busy with a real life project that is killing all the hours I have. Please ask somebody else.

Link to comment

Thats all what you need (If I didnt forget anything)

local theTime = getRealTime()
local secondsToAdd = 4500
local timeForPlayer = theTime.timestamp+(secondsToAdd)
setAccountData (acc, "time", timeForPlayer )

--Your checker funciton
local theTime = getRealTime()
if theTime.timestamp > getAccountData(acc,"time") then
	-- DO WHATEVER YOU WANT
end

 

Edited by Overkillz
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...