Avaxel

Trap Script For Part

Dec 18th, 2018
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. local trapPart = script.Parent
  2. local function onPartTouch(otherPart)
  3. local partParent = otherPart.Parent
  4. local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
  5. if ( humanoid ) then
  6. -- Set player's health to 0
  7. humanoid.Health = 0
  8. end
  9. end
  10. trapPart.Touched:Connect(onPartTouch)
Add Comment
Please, Sign In to add comment