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

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

Asked by
CjayPlyz 643 Moderation Voter
5 years ago
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.

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. LennyPlayzYT 269 — 5y
0
Use the Changed event. hiimgoodpack 2009 — 5y
0
Wow cherrythetree. Just wow. DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Just use while true do and transfer values inside.

Ad

Answer this question