Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

While Opened.Value == true do doesn't work but works with just while true do?

local Points = game.Players.LocalPlayer:WaitForChild("stats"):WaitForChild("Points")
local Opened = script.Parent.Parent.Parent.Opened -- Is a bool value
local TextLabel = script.Parent

while Opened.Value == true do
    TextLabel.Text = "POINTS : " .. Points.Value
    wait(1)
end

I don't really have that much to explain.. this script is supposed to change the text of the textlabel while opened is true. The script works if i just change it to while true do so i guess the problem is while Opened.Value == true do, it doesn't show any errors.

3 comments

0

Or you could also do, while true do, then inside, you can add a 'if Opened.Value == true then', or you can do what cherrythetree recommended.

0

Use the Changed event.

0

Wow cherrythetree. Just wow.

1 answer

Just use while true do and transfer values inside.

This discussion is preserved as it was. New answers, comments, and votes are closed.