local Timer = script.Parent.Timer local time = 0 local Button = script.Parent.Button Button.MouseButton1Click:Connect(function() while true do wait(1) time = time + 1 print(time) end end) Timer.Text = time time.Changed:Connect(function() Timer.Text = time end)
You're overcomplicating it:
local Timer = script.Parent.Timer local time = 0 local Button = script.Parent.Button Button.MouseButton1Click:Connect(function() while true do wait(1) time = time + 1 Timer.Text = tostring(time) --// You don't have to put the tostring there, it's just a precaution end end) Timer.Text = time
local Timer = script.Parent.Timer local time = 0 local Button = script.Parent.Button Button.MouseButton1Click:Connect(function() while wait(1) do time = time + 1 Timer.Text = time end end)
Closed as Non-Descriptive by MachoPiggies and User#5423
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?