Turns out the hitbox wasn't welded to the noob.
I'm making a game where waves of noobs attack the player and they must defend themselves. Here is my script: (Inside the noob Model)
local noob = script.Parent
local noobHuman = noob:WaitForChild("Humanoid")
local hBox = noob:WaitForChild("Hitbox")
local damage = 40
hBox.Touched:Connect(function(obj)
print("touched")
local human = obj.Parent:FindFirstChild("Humanoid")
if human and obj.Parent.Name ~= "Noob" then
print("person")
if script.Parent.Health ~= 0 then
human.Health -= 5
end
end
if obj.Name == "Bullet" then
print("shot")
noobHuman.Health -= damage
obj:Destroy()
if noobHuman.Health <= 0 then
_G.deadNoobs += 1
end
end
end)
It prints "touched" every time it's touched, but never prints "shot" or "person". There are no errors, and I am very confused.
