Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Dunk Tank built and scripted on 2/15/2015 4:33 PM by wrightracer3n
- sp = script.Parent
- DunkTankSeat = sp.DunkTankSeat
- Btn = sp.Button
- Water = sp.Water
- KillingWater = false -- if you want the water to kill people, change this to true
- ActivateWater = false
- DunkedPos = sp.DunkedPos
- DunkingPlayer = false -- Debounce to prevent seat from jamming
- Btn.Touched:connect(function(hit)
- DunkPlayer()
- end)
- function DunkPlayer()
- if DunkingPlayer == false then -- Checking that debouce to make sure we don't spam the seat
- DunkingPlayer = true -- Setting debounce to true, so it activates
- ActivateWater = true
- DunkTankSeat.PrimaryPart = DunkTankSeat.Union
- local DefaultPos = DunkTankSeat.PrimaryPart.CFrame
- DunkTankSeat:SetPrimaryPartCFrame(DunkedPos.CFrame)
- DunkTankSeat.Seat.Disabled = true
- wait(2)
- DunkTankSeat.Seat.Disabled = false
- DunkTankSeat:SetPrimaryPartCFrame(DefaultPos)
- DunkingPlayer = false -- We've done dunked the player by now, so we can set debounce back to false
- ActivateWater = false
- end
- end
- Water.Touched:connect(function(hit)
- if hit.Parent:findFirstChild('Humanoid') and KillingWater == true and ActivateWater == true then
- hit.Parent:findFirstChild('Humanoid').Health = 0
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment