function Shoot() if Ammo > 0 then local ray = Ray.new(script.Parent.Handle.CFrame.Position, (Mouse.Hit.Position - script.Parent.Handle.CFrame.Position)) local Hit,position = workspace:FindPartOnRayWithIgnoreList(ray,{script.Parent.Handle}) local magnitude = (script.Parent.Handle.Position - Mouse.Hit.Position).Magnitude if Hit ~= nil then print(Hit.Parent.Name) if Hit.Parent:FindFirstChild("Humanoid") then Hit.Parent.Humanoid:TakeDamage(5) elseif Hit.Parent.Parent:FindFirstChild("Humanoid") then Hit.Parent.Parent.Humanoid:TakeDamage(5) end end end end
From time to time, it does not do any damage. Yes, the script has a button1down function that fires the function. But why does it not do damage each time?