BrunoV20 Posted October 24, 2017 Share Posted October 24, 2017 I would like to know how I do that by itself such a day goes in gives something to the user! Link to comment
Callum Posted October 24, 2017 Share Posted October 24, 2017 (edited) As a basic outline, you will want to make use of timers, and (I'd imagine) givePlayerMoney. Edited October 24, 2017 by Callum Link to comment
BrunoV20 Posted October 24, 2017 Author Share Posted October 24, 2017 I am saying how I do so that for every day that logee on the server gives them something Link to comment
ShayF2 Posted October 25, 2017 Share Posted October 25, 2017 (edited) 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 October 25, 2017 by ShayF 1 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