When you're comparing stuff, like if game.Workspace.Part.Anchored = true
that would be incorrect. You have to use ==
to see if something is true. Also things like else
and elseif
can be very useful in an if function. For example;
1 | if game.Workspace.Part.Anchored = = true then |
2 | print 'part is anchored' |
4 | print 'part is not anchored' |
So you see what else is used for? Basically if that isn't true. elseif
is used like this:
1 | if game.Workspace.Part.Anchored = = true then |
2 | print 'part is anchored' |
3 | elseif game.Workspace.Part 2. Anchored = = true then |
4 | print 'part2 is anchored' |
So basically you can use to if's in one function! Pretty useful right?
I hope you understand if functions and comparing objects! Also if this helped please accept the answer and a little credit would be nice :)