When a part touches a person can the part deal 40 damage on touching the person then remove then put a damage prevenatation it so it doesn't happen again. Because if a character touches it many scripts make it do 40 damage several times. Thanks!
local Touching = false Damage = 40 script.Parent.Touched:connect(function(hit) hum = hit.Parent:FindFirstChild('Humanoid') if hum ~= nil and not Touching then Touching = true hum:takeDamage(Damage) Touching = false end end)
put this Script into the part that's gonna Damage People...
Damage = 40 script.Parent.Touched:connect(function(t) if t.Parent:FindFirstChild("Humanoid") then t.Parent.Humanoid.Health = t.Parent.Humanoid.Health - Damage end end)
Put in the script.