#how could i fix this touched error?(fixed)

1 messages · Page 1 of 1 (latest)

jaunty osprey
#

error: lua 23:02:38.786 Humanoid is not a valid member of Workspace "Workspace" - Client - CheckActivation:130
script:lua local touched touched = hitbox.Touched:Connect(function(hit) if hit.Name == "BLock" then touched:Disconnect() elseif hit.Parent.Humanoid and hit.Parent.Humanoid ~= Root.Parent.Humanoid and hit.Parent.Humanoid.Health > 0 then touched:Disconnect() comboCount += 1 local HIT = hit.Parent remote:FireServer(HIT,comboCount) end end)

#

so if i touch smth else then an humanoid i keep getting this error

#

idk how to fix it

tall hatch
#

Which one is line 130

jaunty osprey
#

1 sec

torn flicker
#

Use FindFirstChild

jaunty osprey
#

k

torn flicker
#

if hit.Parent:FindFirstChild("Humanoid")

jaunty osprey
#

ik

tall hatch
jaunty osprey
#

ye

#

but @torn flicker thing worked now i dont get error anymore

tall hatch
#

Wack

jaunty osprey
#

thx for your time tho

tall hatch
#

if hit.Parent.Humanoid ~= nil

that'd be my solution I guess

torn flicker
#

It will error

#

If you want to check if an instance is there or not, you need to use FindFirstChild

jaunty osprey
#

ye i tried what lua said before but it still gave error