Jump to content

Help Me!!


BrunoV20

Recommended Posts

local daily = {}

addEventHandler('onPlayerLogin',resourceRoot,function runEvent()
	local serial = getPlayerSerial(source)
	if not daily[serial] then daily[serial] = false end
	if daily[serial] == false then
		daily[serial] = true

		local newMoney = math.random(1000)
		setPlayerMoney(source,getPlayerMoney(source)+newMoney)
		outputChatBox('You have received your daily reward of $'..newMoney..' enjoy!',source,0,255,255)

		setTimer(function()
			daily[serial] = false
		end,86400000,1)
	end
end)

86,400,000 is milliseconds, it represents a day.
1 second = 1,000 milliseconds
1 minute = 60 seconds
1 hour = 60 minutes
1 day = 24 hours
1,000*60*60*24 = 86,400,000

Edited by ShayF
  • Thanks 1
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...