I made this code and it does no damage it only does damage really up close but the attack grows out like an explosion also the part is a mesh inside a part but i don't understand why it only takes damage up close the part grows too.
local Explosion = game.Lighting.ExplosionEffect:Clone()
Explosion.Parent = game.Workspace
Explosion.Position = player.Character.UpperTorso.Position
Explosion.Anchored = true
script.Explosion:Play()
local hum = player.Character.Humanoid
local damaged = true
Explosion.Touched:Connect(function(hit)
if not damaged then return end
damaged = false
local ehum = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid")
if ehum and ehum ~= hum then
ehum:TakeDamage(40)
wait(5)
end
damaged = true
end)
for i=1, 20 do
Explosion.Size = Explosion.Size + Vector3.new(2,2,2)
wait()
end
Explosion:Remove()

3 comments
Try doing "hum.Health = hum.Health - 40"
I agree with FireJxsus. You should do that.
use hum:TakeDamage(40)