Hi, i've made a script that creates a blast in front of the player. When the ball appears and grows, it's supposed to deal damage to people (or entities) it encounters. I used the ":Touched()" function so it detects every part that touch the blast and it deals damage to its owner. However, as it detects many parts from the same player, it damages the same player more than once. Here's the script :
local transparency = 0 local blast = Instance.new("Part", game.Workspace) blast.Shape = "Ball" blast.CanCollide = false blast.Anchored = true blast.Size = Vector3.new(0.5,0.5,0.5) blast.Touched:connect(function(hit) for _, char in pairs(game.Workspace:GetChildren()) do if char:FindFirstChild("Humanoid") then if hit.Parent == char or hit.Parent.Parent == char then if hit.Parent.Name ~= player.Name and hit.Parent.Parent.Name ~= player.Name then char.Humanoid:TakeDamage(50) end end end end end) for i=1,14 do transparency = transparency + 0.072 blast.Transparency = transparency blast.Size = blast.Size + Vector3.new(1.5,1.5,1.5) wait() end