Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how can I make an acid rain when touched the rain we reduce 30 damage by adding my code ?

Asked by 3 years ago
Edited 3 years ago

while true do wait() local random1 = math.random(122, 154) local random2 = math.random(-176, -122) local part = Instance.new("Part", game.Workspace) part.Anchored = false part.Transparency = 0.6 part.Size = Vector3.new(0.5, 2, 0.5) part.Position = Vector3.new(random1, 59.5, random2) part.CanCollide = false end

1 answer

Log in to vote
0
Answered by 3 years ago
Part.Touched:Connect(function(Touch)

    if Touch and Touch.Parent then

        if Touch.Parent:FindFirstChild("Humanoid") then

            local Humanoid = Touch.Parent.Humanoid

            Humanoid:TakeDamage(0) --Change 0 to your damage.
        end
    end
end)
Ad

Answer this question