Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

1 comment

0

show your attempt, your script that we can fix please.

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.