This is the code i have, i just thought it was irrelevant, this is client side.
function onPayDay ()
local money = math.random( 400, 800 )
local player = getLocalPlayer()
local currentMoney = getPlayerMoney( player )
outputChatBox(" ")
outputChatBox("|||------------ Pay Day ------------|||", 70, 200, 0)
outputChatBox(" ")
outputChatBox("Saldo actual -| #EEDDAA"..currentMoney, 250, 250, 250, true)
outputChatBox("Ganho -| #EEDDAA"..money, 250, 250, 250, true)
outputChatBox("Novo saldo -| #EEDDAA"..currentMoney + money, 250, 250, 250, true)
outputChatBox(" ")
outputChatBox("|||------------------------------------|||", 70, 200, 0)
exports.players:giveMoney( player, money )
givePlayerMoney( player, money )
end
addEvent( "isTimeToPayDay", true)
addEventHandler( "isTimeToPayDay", getRootElement(), onPayDay)
Server side i have this.
function payDay ()
local time = getRealTime()
local minutes = time.minute
local seconds = time.seconds
if minutes == 00 and seconds == 0 then
triggerClientEvent("isTimeToPayDay", getRootElement())
end
end
addCommandHandler( "paycheck",
function ( playerSource, commandName )
triggerClientEvent("isTimeToPayDay", getRootElement())
end
)
addEventHandler("onResourceStart", resourceRoot, function () setTimer(payDay, 1000,0) end)
I don't understand what you mean with this...
Thanks for helping.