I am trying to figure out how to code a killbrick system can someone help me?
local trapPart = script.Parent
Hello snooxy, I am here to help you.Here is the code:
local trapPart = script.Parent trapPart.CanCollide = false local function onPartTouch(otherPart) local partParent = otherPart.Parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") if humanoid then -- Set player's health to 0 aka killing them humanoid.Health = 0 end end trapPart.Touched:Connect(onPartTouch)