Making a live event that runs every weekend

I want to make a live event that runs every weekend for things like making players earn more of a stat on weekends or things like that.

The problem is that I don’t know how to go about modifying my code to make it repeat every weekend.

This is example code I have created.

while true do
	task.wait()
	if os.time() >= 1663304401 and os.time() < 1663563601 then
		script.Parent.Text = "Boost Active"
	else
		script.Parent.Text = "Boost Not Active"
	end
end
1663304401 -- Start Of Friday 
1663563601 -- Start Of Monday

How would I go about making this code repeat every friday-monday?

2 Likes

As to make it repeat…

1 Like

This is helpful, but I mainly made this post with the intention of repeating the live event every weekend automatically.

1 Like

I suppose you could detect it using a while loop and:

local wday = os.date("*t").wday
print(wday) --'5', Today is Friday.
if wday == 1 or wday == 7 then --Sunday or Saturday.
	--Code.
end
2 Likes