I know why, but I don't know how I can fix, I guess it's impossible

Read what I said. The code I am saying determines if it isn’t nil.

Could you do some debugging and find out where the issue is?

You aren’t even going to try our suggestions? You are just going to say that they definitely won’t work?

1 Like

I am not talking about errors, I want you to see how the value of those variables three and two change. During debugging, check the values of these variables.

I tried your suggestions

but didn’t working
and I know if most of them will work

was I rude? i never noticed

Where did I be rude?

Could you atleast tell us what the values of those variables were during debugging?

local three is true or nil
local two is true or false
if local three is true, this while do working
but if local three is true this line 4 coding is dont have error

but said have error

I guess it’s impossible to fix, this code

Are you absolutely sure that is the code giving this error? The error says that Swordpiece2_ is not a valid member. However, your code on the fourth line is indexing with Swordpiece2, not Swordpiece2_.

1 Like

yes I am sure
because after clicking on line 4 the script was opened

Well, it seems impossible that this code would give that error, but if you’re sure, then put a print(two, three) into the while loop, before the line that errors. And tell what is printed.

two is true
three is Swordpiece2 = true

It is because, this script cannot find a part named Swordpiece2:

local three = script.Parent.Parent:FindFirstChild("Swordpiece2")

This script is what’s causing the problem, try using “Swordpiece2” so it wouldn’t cause the problem.

local two = script.Parent.Name == "Swordpiece2_"

A fixed script:

local two = script.Parent.Name == "Swordpiece2"
local three = script.Parent.Parent:FindFirstChild("Swordpiece2")

while two and three do



If it happened to not work, try using locals.

local swordpiece = game.Workspace.Swordpiece2_ -- Determine the Part

well this happen to me too, i used parent:FindFirstChild(‘a thing’) ~= nil instead of parent:FindFirstChild(‘a thing’)

Det ?

I meant:


does it still not work? can u show us what is script.parent.parent and its children

Why you changed name ?
name is correct not wrong
I did not enter its name wrong

read local three
then read while … do

if you read correct, you can understand