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

Damage over time on touch?

Asked by 10 years ago

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

2 answers

Log in to vote
0
Answered by
Seenit 80
10 years ago
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)

Ad
Log in to vote
0
Answered by
Tyjoga 0
10 years ago

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)

Answer this question