I have a date system that words like so:
I have one text box called “month” and another called “year”
Under “month” is so
while wait(2) do
script.Parent.Text = tostring(tonumber(script.Parent.Text) + 1)
if script.Parent.Text == "12" then
wait(2)
script.Parent.Text = "1"
end
end
And under “year” is so
while wait(2) do
if script.Parent.Parent.month.Text == "12" then
wait(2)
script.Parent.Text = tostring(tonumber(script.Parent.Text) + 1)
end
end
I have a script ontop of all that that has one purpose.
When month reaches a certain value, and when year reaches a certain value, I want to run an event from my module script.
But to constantly check with a while wait(2) do, I feel like that would lag the game.
Is there any better way to do this?