Why does this hurt the player that pressed the key rather than the person getting touched. I don't want the player who pressed the key to be harmed. This script is cloned into a part that shoots. When the player presses a button the part is fired
function onDamage(Part)
if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= script.Parent.Name then
script.Disabled = true
f = Instance.new("Fire", Part)
f.Color = Color3.new(1, 0, 0)
for i = 1,25 do
f.Size = f.Size +0.25
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -2.5
wait(0.05)
end
Part.Parent.Humanoid.Sit = true
f:remove()
script.Parent:remove()
end
wait(0.025)
end
script.Parent.Touched:connect(onDamage)

3 comments
How would I do that?
The problem is that the player that shoots the part is damaged which causes my script to disable. It shouldn't hurt the other player.
@Relampago1204 Create an if statement that sees who hits the bullet. Or, you can reposition th bullet so it doesn't hit the owner