Gun will not damage

I’ve made bullets fly out of my gun. But when it Touches a player. It does nothing!

Script:

function damage(char, dmg, bullet, damageType)
	if char ~= luger.Parent then
		char:FindFirstChild("HealthStats"):FindFirstChild("Health").Value = math.max(char:FindFirstChild("HealthStats"):FindFirstChild("MinHealth").Value, char:FindFirstChild("HealthStats"):FindFirstChild("Health").Value - dmg)
		game:GetService("Debris"):AddItem(bullet, 0)
	end
end

function bulletMaker()
	local bullet = instances:FindFirstChild("Bullet"):Clone()
	bullet.Parent = workspace
	bullet.CFrame = luger.Parent:WaitForChild("CamCFrame").Value * CFrame.new(0, 0, -5)
	game:GetService("Debris"):AddItem(bullet, 8)
	bullet.Touched:Connect(function(BP)
		if BP.Name == "HeadHitbox" then
			damage(BP.Parent, SeTtInGs.bulletStats.headshotDamage, bullet, "headshot")
			events:WaitForChild("PlaySound"):FireClient(game:GetService("Players"):GetPlayerFromCharacter(luger.Parent), luger:WaitForChild("Handle"), sounds:WaitForChild("HeadshotSound"))
		elseif BP.Parent:FindFirstChildOfClass("Humanoid") then
			damage(BP.Parent, SeTtInGs.bulletStats.damage, bullet, "standard")
		end
	end)
end

function onClick()
	bulletMaker()
end

luger.Activated:Connect(onClick)

Never mind I fixed it! Lol, and how I did it is pretty hard to explain but I will say it anyways.

So I made a new script and located it into the bullet. And made a damage script in the bullet instead of the gun script

1 Like