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

kill when stop function help?

how wold i make in this have also add when you stop it kills you?

local debounce = false 

function onTouch(part) 

local human = part.Parent:findFirstChild("Humanoid") 
if (human ~= nil) and debounce == false then 

debounce = true 

human.WalkSpeed = 50
wait(2) 
debounce = false 
end 
end 


script.Parent.Touched:connect(onTouch) 

1 answer

✓ Accepted answer
local debounce = false 

script.Parent.Touched:connect(function(hit)

if not debounce then

debounce = true

local getPlayer = game.Players:GetPlayerFromCharacter(hit.Parent)
local findPlayer = game.Workspace:FindFirstChild(player.Name)

findPlayer.Humanoid.Health = 0

debounce = false

end

end)

The script above kills the player when they touch it. Not exactly sure what else you need because I don't understand what you typed. If this script doesn't work, let me know.

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