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 6 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?

while true do
    wait()
    script.Parent.Text = script.Parent.Time.Value
end

The two values are StartTime and EndTime.

1 answer

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

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

Full Code:

while true do
    wait()
    script.Parent.Text = script.Parent.Time.Value
    if script.Parent.Time.Value==0 then
        --Do stuff when the timer ends
    end
end

Ad

Answer this question