signal is nil so i can't disconnect it from RBLXScriptSignal, it returns this: " ServerScriptService.ProceduralGen:50: attempt to index global 'signal' (a nil value)". I don't get it...
local closeByCheck = function(ply,n)
print("Called")
local signal = ply:FindFirstChild("Right Leg").Touched:connect(function(otherPart)
signal:disconnect()
print("Touched")
print(otherPart.Parent)
if otherPart.Parent == game.Workspace.Grid then
print("Part is grid")
if (ply.HumanoidRootPart.Position - otherPart.Position).magnitude < startRange then
print("Part is close")
print("N is: "..n)
closeByPart[n] = otherPart
end
end
end)
return true
end

1 comment
It may be because Right Leg doesn't exist. Try WaitForChild instead.