Simple Code Commission

I need code that will award all users x amount per (in game) day at 6:00 AM. The current code (made by @EmeraldSlash) works but has a glitch where it doubles per user. Since this little game is commission based, we would appreciate any help we can get. I’m in a stressful situation. I can pay Robux or USD for this.

2 Likes

The logic behind this would be to track time changes. Keep a record of the last change. When the time changes, see if the last-tracked time is before 6 and the current time is at or after 6. Then trigger an event or whatever to award the users:

local lighting = game:GetService("Lighting")
local lastTime = lighting.ClockTime

local AWARD_TRIGGER_HOUR = 6

function AwardPlayers()
	-- Award the players
end

lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
	local now = lighting.ClockTime
	if (lastTime < AWARD_TRIGGER_HOUR and now >= AWARD_TRIGGER_HOUR) then
		AwardPlayers()
	end
	lastTime = now
end)

Oops, I’m now seeing this is a commission thing. Sorry if you were looking for something more than that.

2 Likes

Hey I messaged you on Discord

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.