Still have questions? Join our Discord server and get real time help.
Log in to vote

Equal sign is red and I don't know what to do?

Asked by
higzl 17
3 years ago
if script.Parent.Parent.Door.CanCollide = true then

It shows that = is red, I don't get it and I need help with it.

Please accept one of the answers below or put [ANSWERED] so we know that this question is answered. With out doing so we would come here and try to answer a question that is already answered. BlackOrange3343 2658 — 3y
The reason is because its an "if" statement. writing one equal sign means you are trying to change the value. In an if statement u must use two equal signs like so: if script.Parent.Parent.Door.CanCollide == true then RequiredModule 33 — 3y

1 answer

Log in to vote
Answered by 3 years ago

When you are making an if statement and want an equal condition, then you would have to use ==. For example:

if script.Parent.Parent.Door.CanCollide == true then
Thank you higzl 17 — 3y
Please press accept answered. Thanks! marioblast1244 113 — 3y
^^^^ This answer is the better answer ^^^^ MrLonely1221 696 — 3y
Thanks MrLonely1221! marioblast1244 113 — 3y

Answer this question