How do I make is so that the killbrick can be either insta-kill or not via a bool value? I tried to do this several times but the killbrick does not kill the player or the player takes non-instant kill damage. Is there any way I can do something like this?
Note: non instant kill means that the player takes damage but the player isnt killed instantly.
local Debounce = false
for _,v in pairs(script.Parent:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:Connect(function(hit)
if Debounce == false then
Debounce = true
local Player = hit.Parent:FindFirstChild("Humanoid")
if Player then
Player.Health = Player.Health - 30
wait(0.5)
Debounce = false
end
end
end)
end
end
Thanks for reading!

1 comment
I don't know why it looks so dirty but it's not my fault ;(