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

How do i prevent people not dying on the killbricks?

Asked by 3 years ago

I have a lot of kill bricks and use this code: script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end) but the thing is some people can keep jumping on them and somehow survive. I don't know how to prevent them from doing it

1 answer

Log in to vote
0
Answered by 3 years ago

When you want to type a script, click the blue Lua button

It might have been a glitch or a slow reaction, you might be able to stop it using loops

(Put this in the killbrick)

script.Parent.Touched:Connect(function(hit)
    repeat
        hit.Parent.Humanoid.Health = 0
        wait(0.001)
    until hit.Parent.Humanoid.Health == 0
end)
0
I hope this was helpful NathanBlox_Studios 212 — 3y
Ad

Answer this question