This is what I tried:
while true do
wait(0.2)
if script.Parent.Parent.Countdown.Text = "0" then -- error :/
script.Parent.Value = true
end
end
The error reads "Expected 'then', got '='"
This is what I tried:
while true do
wait(0.2)
if script.Parent.Parent.Countdown.Text = "0" then -- error :/
script.Parent.Value = true
end
end
The error reads "Expected 'then', got '='"
= is used for assignment. That is, it sets the name at the left with the value on the right.
== is used for comparison. It is an operator that compares the left value with the right value.
Because = forms a full statement but the condition of an if requires an expression, it says it thinks you forgot the then, as in
if a == b
c = d
(It expected to see a then before getting =)
I recommend using this Wiki page.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
For conditions, it needs a double equals. ("==") not "="
Oh! Thank you!