Hi, I’m making play time in my game, but something isn’t working. It’s just counting the seconds, but if you’ve reached 60 seconds it’s not decreasing and adding +1 to minutes. Script:
game.Players.PlayerAdded:Connect(function(Player)
while wait(1) do
Player:WaitForChild("Time"):WaitForChild("Seconds").Value += 1
end
Player:WaitForChild("Time"):WaitForChild("Seconds").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Seconds").Value >= 60 then
Player:WaitForChild("Time"):WaitForChild("Seconds").Value -= 60
Player:WaitForChild("Time"):WaitForChild("Minutes").Value += 1
end
end)
Player:WaitForChild("Time"):WaitForChild("Minutes").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Minutes").Value >= 60 then
Player:WaitForChild("Time"):WaitForChild("Minutes").Value -= 60
Player:WaitForChild("Time"):WaitForChild("Hours").Value += 1
end
end)
Player:WaitForChild("Time"):WaitForChild("Hours").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Hours").Value >= 24 then
Player:WaitForChild("Time"):WaitForChild("Hours").Value -= 24
Player:WaitForChild("Time"):WaitForChild("Days").Value += 1
end
end)
Player:WaitForChild("Time"):WaitForChild("Days").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Days").Value >= 7 then
Player:WaitForChild("Time"):WaitForChild("Days").Value -= 7
Player:WaitForChild("Time"):WaitForChild("Weeks").Value += 1
end
end)
Player:WaitForChild("Time"):WaitForChild("Weeks").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Weeks").Value >= 4 then
Player:WaitForChild("Time"):WaitForChild("Weeks").Value -= 4
Player:WaitForChild("Time"):WaitForChild("Months").Value += 1
end
end)
Player:WaitForChild("Time"):WaitForChild("Months").Changed:Connect(function()
if Player:WaitForChild("Time"):WaitForChild("Months").Value >= 12 then
Player:WaitForChild("Time"):WaitForChild("Months").Value -= 12
Player:WaitForChild("Time"):WaitForChild("Years").Value += 1
end
end)
end)
That looks sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo hard lol