I am trying to figure out how to code a killbrick system can someone help me?
local trapPart = script.Parent
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You chcanoose how much damage it will take from humanoid.