Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a script that changes values?

Asked by 7 years ago

I have a script for a timer that counts it down but when it ends I want it to change the values? How would I do that?

1while true do
2    wait()
3    script.Parent.Text = script.Parent.Time.Value
4end

The two values are StartTime and EndTime.

1 answer

Log in to vote
0
Answered by
lukeb50 631 Moderation Voter
7 years ago
1if script.Parent.Time.Value==0 then
2    --Do stuff when the timer ends
3end

This would detect when the "Time" Value becomes 0 and executes whatever code you need.

Full Code:

1while true do
2    wait()
3    script.Parent.Text = script.Parent.Time.Value
4    if script.Parent.Time.Value==0 then
5        --Do stuff when the timer ends
6    end
7end
Ad

Answer this question