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

Damage over time on touch?

How would one create a script that damages the player when they touch a certain brick?

2 answers

function onTouched(hit)
	local human = hit.Parent:findFirstChild("Humanoid")
	if (human ~= nil) then
		human.Health = human.Health - 100 --This is how much is taken away
		wait(2)
	end
end

script.Parent.Touched:connect(onTouched)

If you get lazy, you can always find a Venomshank model, edit the "hurting over time" script, and put it into a block. (For a block that hurts long after touching)

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