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

How do I create a brick where if the player is in, they will slowly take damage?

Asked by 3 years ago

So I was thinking to have a wall closing in so that my round does not go on forever. When the player is in that wall, they will take damage. How do I do that? I've tried something but the player remains unharmed while inside the zone, only taking damage upon entry.

0
show your attempt, your script that we can fix please. imKirda 4491 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Hope this helps

function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") then
        while true do
            hit.Parent.Humanoid:TakeDamage(1)
            wait()
        end 
    end
end

script.Parent.Touched:connect(onTouched)
Ad

Answer this question