No.
workspace.Part8
would be a Part, an Instance. false
is not an instance, so they cannot be equal.
The first (only) parameter to a Touched event is which part touched it. We can compare this parameter to workspace.Part8
to make sure it is workspace.Part8
triggering the Touch event:
1 | function Touched(partTouching) |
2 | if partTouching ~ = workspace.Part 8 then |
I would say that in general it would probably be better to organize it like this instead, because it's easier to see at a glance what is going on:
1 | function Touched(partTouching) |
2 | if partTouching = = workspace.Part 8 then |
But both versions work.
Instead of comparing workspace.Part8
and partTouching
, you could just check the Name of partTouching
:
1 | if partTouching.Name = = "Part8" then |
This doesn't act the same, since there could be more than one Part8
but it may be sufficient. It's also useful if there are several parts which you want to accept and workspace.Part8
isn't the only one.