Headshots not working

I tried removing the debounce and destroying the bullet, but it insta kills because of no debounce, no errors

When you removed the debounce did it deal damage with headshots?

Yeah, technically. I don’t want the body to instantly die after getting shot, though.

Then the problem must be the debounce or something, but that doesn’t really make sense.

Here’s the script if you still want to fix it. I’m almost ready to give up at this point:

local bullet = script.Parent

local debris = game:GetService("Debris")
local debounce = false

bullet.Touched:Connect(function(hitpart)
	local player = game.Players:GetPlayerFromCharacter(hitpart.Parent)
	local Attacker = hitpart.Parent:FindFirstChild("Attacker")
	print(hitpart)
	if player and Attacker.Value ~= player.Name then
		if debounce == false then
			debounce = true
			hitpart.Parent.Humanoid:TakeDamage(30)
		debris:AddItem(bullet)
		elseif player and Attacker.Value ~= player.Name and hitpart.Name == "Head" then
			if debounce == false then
				debounce = true
				hitpart.Parent.Humanoid:TakeDamage(100)
		debris:AddItem(bullet)
			end
		end
	end
end)

I fixed it myself! What I did was remove the debounce, and destroyed the bullet when it touches a part. Thanks to everybody who helped!

2 Likes

i just saw here u forgot to put the end in the first debounce i think thats why it wasn’t working try re-putting the debounce and do that, also destroy() has a delay to delete the bullet when it touches soo it could touch and damage multiple times soo use debris(bullet, 0) to delete the bullet when it touch