I have a acid rain system in game game and I want to make it so when I pull a tool out (in my case an Umbrella) I wont take any damage in the acid rain part.
(still a new scripter any help is appreciated)
Acid Rain Script
local DAMAGE = 3
local INTERVAL = 17/30
local touchingHumanoids = {}
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
touchingHumanoids[humanoid] = true
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
touchingHumanoids[humanoid] = nil
end
end)
while true do
for humanoid in pairs(touchingHumanoids) do
humanoid:TakeDamage(DAMAGE)
end
task.wait(INTERVAL)
end