local b = game.Workspace.Hello.Value
local h = true
h = true if b == 10
else h == false
while h == true do
wait(40)
script.Parent.Text = "20"
✓ ANSWER ACCEPTED
Is this the right way to use if function?
1 answer
✓ Accepted answer
Yes but No you should use an if statement in a different line
and change the value of h inside the if statement and remove "h = true" outside the if statement
also, put a then after the if statement
You should also have an "end" at the end of a while loop.
You also forgot an end at the end of your if statement like so
Like this:
local b = game.Workspace.Hello.Value
local h = true
if b == 10 then
h = true
else
h == false
end
while h == true do
wait(40)
end
script.Parent.Text = "20"
9 comments
0
Wrong he simply forgot and end
0
Lol u edited
0
Thx ill try it
0
Thx ill try it
0
Glad I could hlp
0
This script didn't work
1
what error does it show
0
It works now thx
0
Can you accept this answer then
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
You forgot a then
where should the then be
where should the then be
After 10 (not line 10)
Thx