I kept wondering how could I make a while read
while wait(0.5) do
if game.Players.LocalPlayer.leaderstats.Points.Value=="2000" then
script.Parent.Text = "Good job!"
end
end
the script being in a Gui's Label.
If anyone has an answer to this, I will give all my love <3
Thank you for taking the time to answer :)
It works, but i made a different version of the script.
while true do wait(0.5) if game.Players.LocalPlayer.leaderstats.Points.Value == 2000 then local Playername = game.Players.LocalPlayer.Name script.Parent.Text = "Good job, " .. Playername end end
It would probably work yeah, that doesn't mean that it would work reversed (setting a value in a local script isn't a good idea)
The while loop is okay but do you really need it to test a value ever 0.5 second?
EDIT: This won't work as 'Points' is a int/number value but what you wrote is a string value, to fix it simply change "2000" to 2000 ("' makes everything between a string)
(Also use :WaitForChild !!!)