So basically I have a if statement and when the thing I’m checking for isnt there then it makes an error.
Code:
if part.Parent:FindFirstChild('Humanoid') then -- this is where it is erroring
print('This is a hum')
local hum = part.Parent:FindFirstChild('Humanoid')
hum:LoadAnimation(script:FindFirstChild('Backwards')):Play()
end
The error I get is the standard
ServerScriptService.Attacks.EffectsModule:20: attempt to index nil with 'FindFirstChild'