Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to code a killbrick system?

Asked by
iivSnooxy 248 Moderation Voter
3 years ago

I am trying to figure out how to code a killbrick system can someone help me?


local trapPart = script.Parent

1 answer

Log in to vote
0
Answered by
goodlead -62
3 years ago
Edited 3 years ago

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)
0
You  chcanoose how much damage it will take from humanoid. goodlead -62 — 3y
Ad

Answer this question