So my last question I accidentally made it seem like I was trying to do something else.. I am not trying to target multiple children actually. I am trying to target a child of several different children.
local wasTouched = false
local npcScript = game.Workspace:FindFirstChild("PathNPC").NPC:FindFirstChild("Walk")
part.Touched:Connect(function(hit)
if not wasTouched then
wasTouched = true
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
npcScript.Disabled = false
end
wasTouched = false
end
end)
This is the script I am trying to fix.
local npcScript = game.Workspace:FindFirstChild("PathNPC").NPC:FindFirstChild("Walk")
This is what I believe to be my error. here I tried to target the script "Walk" but I am not experienced with lua at all.
What am I doing wrong? The script is under Workspace, then PathNPC, then NPC. / Its parent is NPC, NPC's parent is PathNPC, and PathNPC's parent is Workspace.

1 comment
thanks! I'll try this.