Function returning false even if instances are clearly in table

Hello, I have problem with my script

  1. What do you want to achieve? I want to make function that returns true when TouchPart is touching part/parts called “Wire”.

  2. What is the issue? The problem is that, even if parts called “Wire” are in table (TouchPart is touching them), function still returns false.
    Screen1

  3. What solutions have you tried so far? Tried to look for something related to my problem, but couldn’t find any solution.

I am able to provide any necessary information if needed, thanks

You loop through all the parts and will always return false. Thats because you return even when the name is not equal to “Wire”. You can solve this by getting rid of the return false or adding if Part.Name ~= "Wire" then continue end.

1 Like

That worked, thank you very much :slightly_smiling_face:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.