I just started learning how to script and I made a part that can kill you when touched. But my problem is that every time I play it on studio, it kills me before I even touch the part.
Code:
debounce = false
brick = game.Workspace.Part
function onTouched()
if debounce == true then return end
debounce = true
game.Workspace.Player.Head:Destroy()
wait(2)
debounce = false
end
script.Parent.Touched:connect(onTouched)

2 comments
Thanks, it worked! It's my first time scripting so.. ;P
no prob!