BoostSimon

Untitled

Dec 24th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. -- Dunk Tank built and scripted on 2/15/2015 4:33 PM by wrightracer3n
  2.  
  3. sp = script.Parent
  4. DunkTankSeat = sp.DunkTankSeat
  5. Btn = sp.Button
  6.  
  7. Water = sp.Water
  8. KillingWater = false -- if you want the water to kill people, change this to true
  9. ActivateWater = false
  10.  
  11. DunkedPos = sp.DunkedPos
  12.  
  13. DunkingPlayer = false -- Debounce to prevent seat from jamming
  14.  
  15. Btn.Touched:connect(function(hit)
  16. DunkPlayer()
  17. end)
  18.  
  19. function DunkPlayer()
  20. if DunkingPlayer == false then -- Checking that debouce to make sure we don't spam the seat
  21. DunkingPlayer = true -- Setting debounce to true, so it activates
  22. ActivateWater = true
  23. DunkTankSeat.PrimaryPart = DunkTankSeat.Union
  24. local DefaultPos = DunkTankSeat.PrimaryPart.CFrame
  25. DunkTankSeat:SetPrimaryPartCFrame(DunkedPos.CFrame)
  26. DunkTankSeat.Seat.Disabled = true
  27. wait(2)
  28. DunkTankSeat.Seat.Disabled = false
  29. DunkTankSeat:SetPrimaryPartCFrame(DefaultPos)
  30. DunkingPlayer = false -- We've done dunked the player by now, so we can set debounce back to false
  31. ActivateWater = false
  32. end
  33. end
  34.  
  35. Water.Touched:connect(function(hit)
  36. if hit.Parent:findFirstChild('Humanoid') and KillingWater == true and ActivateWater == true then
  37. hit.Parent:findFirstChild('Humanoid').Health = 0
  38. end
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment