The attack only deals damage to the closest player near it but even the people that are in the attack don't get damaged only the closest player does this is the code
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(1)
end
damaged = true
end)
for i=1, 10 do
Explosion.Size = Explosion.Size + Vector3.new(19,19,19)
wait()
end
Explosion:Destroy()

4 comments
Is this in Filtering Enabled?
Yes
Are you trying to create some sort of grenade or bomb of such?
Its a explosion magic attack.