The explosion doesn't deal damge, how do I fix it? Explosion, Bullet and Damage do have a value so it isn't the problem.

local CheckedForKill = false
		Explosion.Hit:connect(function(PartHit, hitDistance)
			if CheckedForKill == false then
				CheckedForKill = true
				local humanoid = PartHit.Parent:FindFirstChild("Humanoid")
				if humanoid and not PartHit.Name == "Bullet" then
					if hitDistance <= ExplosionRange then
						humanoid:TakeDamage(Damage)
						wait(0.05)
						if humanoid.Health == 0 or humanoid.Health <= 0 then
							local player = game.Players:GetPlayerFromCharacter(user)
							player.leaderstats.Kills.Value = player.leaderstats.Kills.Value + 1
						end
					end
				end
			end
		end)

And here's an example of what happens: https://gyazo.com/8ef8a1f0297641994130a298049330af

2 comments

0

Shouldn't hitDistance be greater than or equal to ExplosionRange? if hitDistance >= ExplosionRange then

0

@JohnTUnderwood No, I want the player to be damaged if they're in the rage of the explosion not out of it...