Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Offbound Script
- local Ball = game.Workspace:WaitForChild("Ball")
- local Offbound1 = game.Workspace:WaitForChild("Offbound1")
- local Offbound2 = game.Workspace:WaitForChild("Offbound2")
- local Offbound3 = game.Workspace:WaitForChild("Offbound3")
- local Offbound4 = game.Workspace:WaitForChild("Offbound4")
- local OriginalPosition = Ball.Position
- local function resetBall()
- Ball.CFrame = CFrame.new(OriginalPosition)
- end
- Offbound1.Touched:Connect(function(hit)
- if hit == Ball then
- resetBall()
- Ball.Anchored = true
- wait(3)
- Ball.Anchored = false
- end
- end)
- Offbound2.Touched:Connect(function(hit)
- if hit == Ball then
- resetBall()
- Ball.Anchored = true
- wait(3)
- Ball.Anchored = false
- end
- end)
- Offbound3.Touched:Connect(function(hit)
- if hit == Ball then
- resetBall()
- Ball.Anchored = true
- wait(3)
- Ball.Anchored = false
- end
- end)
- Offbound4.Touched:Connect(function(hit)
- if hit == Ball then
- resetBall()
- Ball.Anchored = true
- wait(3)
- Ball.Anchored = false
- end
- end)
- ----------------------------------------
- --Kill after Goal Script
- local ball = game.Workspace:WaitForChild("Ball")
- local team1Goal = game.Workspace:WaitForChild("Team1")
- local team2Goal = game.Workspace:WaitForChild("Team2")
- local function killAllPlayers()
- for _, player in ipairs(game.Players:GetPlayers()) do
- if player.Character and player.Character:FindFirstChild("Humanoid") then
- player.Character.Humanoid.Health = 0
- end
- end
- end
- local function onBallTouch(otherPart)
- if otherPart == ball then
- killAllPlayers()
- end
- end
- team1Goal.Touched:Connect(onBallTouch)
- team2Goal.Touched:Connect(onBallTouch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement