Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = owner
- repeat wait() until Player.Character
- local Character = Player.Character
- -- Setting up variables and ect
- local DifficultyLevel = 1
- local Time = 0
- local GameEnd = false
- local Plate = Instance.new("Part",workspace)
- Plate.Size = Vector3.new(30,1,30)
- Plate.CFrame = CFrame.new(-3.75,0.5,-57.5)
- Plate.Anchored = true
- Plate.TopSurface = Enum.SurfaceType.Smooth
- Plate.BottomSurface = Enum.SurfaceType.Smooth
- Plate.Locked = true
- Plate.Name = "Plate"
- local BillboardGui = Instance.new("BillboardGui",Plate)
- BillboardGui.LightInfluence = 0
- BillboardGui.StudsOffset = Vector3.new(0,25,0)
- BillboardGui.Size = UDim2.new(15,0,7.5,0)
- local Annoucements = Instance.new("TextBox",BillboardGui)
- Annoucements.BackgroundTransparency = 1
- Annoucements.TextStrokeTransparency = 0
- Annoucements.Font = Enum.Font.Arcade
- Annoucements.Size = UDim2.new(1,0,0.5,0)
- Annoucements.TextScaled = true
- local Timer = Instance.new("TextBox",BillboardGui)
- Timer.BackgroundTransparency = 1
- Timer.TextStrokeTransparency = 0
- Timer.Font = Enum.Font.Arcade
- Timer.TextScaled = true
- Timer.Position = UDim2.new(0,0,0.5,0)
- Timer.Size = UDim2.new(1,0,0.5,0)
- Timer.TextColor3 = Color3.fromRGB(255,255,255)
- local Boundary1 = Plate:Clone()
- Boundary1:ClearAllChildren()
- Boundary1.Parent = workspace
- Boundary1.Transparency = 1
- Boundary1.CFrame = CFrame.new(-19.25,15,-57.5)
- Boundary1.Orientation = Vector3.new(-90,90,0)
- Boundary1.Name = "Boundary1"
- local Boundary2 = Boundary1:Clone()
- Boundary2.Parent = workspace
- Boundary2.CFrame = CFrame.new(-3.75,15,-42)
- Boundary2.Orientation = Vector3.new(-90,0,0)
- Boundary2.Name = "Boundary2"
- local Boundary3 = Boundary1:Clone()
- Boundary3.Parent = workspace
- Boundary3.CFrame = CFrame.new(-3.75,15,-73)
- Boundary3.Orientation = Vector3.new(-90,0,0)
- Boundary3.Name = "Boundary3"
- local Boundary4 = Boundary1:Clone()
- Boundary4.Parent = workspace
- Boundary4.CFrame = CFrame.new(11.75,15,-57.5)
- Boundary4.Orientation = Vector3.new(-90,90,0)
- Boundary4.Name = "Boundary4"
- local Boundary5 = Boundary1:Clone()
- Boundary5.Parent = workspace
- Boundary5.CFrame = CFrame.new(-3.75,29.5,-57.5)
- Boundary5.Orientation = Vector3.new(0,0,0)
- Boundary5.Name = "Boundary5"
- Character.HumanoidRootPart.CFrame = CFrame.new(Plate.Position.X,Plate.Position.Y+2,Plate.Position.Z)
- -- Functions
- function EndGame()
- coroutine.resume(coroutine.create(function()
- GameEnd = true
- for i,v in pairs(Plate:GetChildren()) do
- wait(.1)
- if v:IsA("Part") then
- Sparkle(v,Color3.fromRGB(255,255,255))
- v:Destroy()
- end
- end
- Announce("Survived "..Time.." Seconds!",Color3.fromRGB(255,255,0))
- Timer:Destroy()
- local Sound = Instance.new("Sound",Plate)
- Sound.SoundId = "rbxasset://sounds/bass.wav"
- Sound.PlaybackSpeed = 3
- Sound.Volume = 2
- coroutine.resume(coroutine.create(function()
- for i = 1,50 do
- wait(.1)
- if Annoucements.TextColor3 == Color3.fromRGB(255,255,0) then
- Annoucements.TextColor3 = Color3.fromRGB(255,0,0)
- Sound:Play()
- elseif Annoucements.TextColor3 == Color3.fromRGB(255,0,0) then
- Annoucements.TextColor3 = Color3.fromRGB(255,255,0)
- end
- end
- end))
- wait(5)
- Plate:Destroy()
- Boundary1:Destroy()
- Boundary2:Destroy()
- Boundary3:Destroy()
- Boundary4:Destroy()
- Boundary5:Destroy()
- script:Destroy()
- end))
- end
- function Announce(Message,Color)
- Annoucements.Text = Message
- Annoucements.TextColor3 = Color
- local Sound = Instance.new("Sound",Plate)
- Sound.SoundId = "rbxasset://sounds/bass.wav"
- Sound.Volume = 3
- Sound:Play()
- end
- Announce("Difficulty Level 1",Color3.new(0,255,0))
- function Sparkle(Object,Color)
- local Part = Instance.new("Part",workspace)
- Part.CanCollide = false
- Part.Anchored = true
- Part.CFrame = Object.CFrame
- Part.Transparency = 1
- Part.Size = Vector3.new(.25,.25,.25)
- Part.Locked = true
- local Sound = Instance.new("Sound",Part)
- Sound.SoundId = "rbxasset://sounds/snap.mp3"
- Sound.Volume = 1
- Sound:Play()
- local ParticleEmitter = Instance.new("ParticleEmitter",Part)
- ParticleEmitter.Lifetime = NumberRange.new(1)
- ParticleEmitter.Color = ColorSequence.new(Color)
- ParticleEmitter.Drag = 10
- ParticleEmitter.SpreadAngle = Vector2.new(5000,5000)
- ParticleEmitter.Speed = NumberRange.new(20)
- ParticleEmitter.Enabled = false
- ParticleEmitter:Emit(10)
- game.Debris:AddItem(Part,1)
- return Part
- end
- function CreateMissile()
- local Missile = Instance.new("Part",Plate)
- Missile.Name = "Missile"
- Missile.Locked = true
- Missile.CanCollide = false
- Missile.BrickColor = BrickColor.new("Toothpaste")
- Missile.Material = Enum.Material.Neon
- Missile.TopSurface = Enum.SurfaceType.Smooth
- Missile.BottomSurface = Enum.SurfaceType.Smooth
- Missile.Size = Vector3.new(1,1,4)
- local RandomSide = math.random(1,4)
- if RandomSide == 1 then
- Missile.CFrame = CFrame.new(math.random(-4,4),0,20)*Character.HumanoidRootPart.CFrame
- Missile.Orientation = Vector3.new(0,0,0)
- elseif RandomSide == 2 then
- Missile.CFrame = CFrame.new(math.random(-4,4),0,-20)*Character.HumanoidRootPart.CFrame
- Missile.Orientation = Vector3.new(0,180,0)
- elseif RandomSide == 3 then
- Missile.CFrame = CFrame.new(-20,0,math.random(-4,4))*Character.HumanoidRootPart.CFrame
- Missile.Orientation = Vector3.new(0,-90,0)
- elseif RandomSide == 4 then
- Missile.CFrame = CFrame.new(20,0,math.random(-4,4))*Character.HumanoidRootPart.CFrame
- Missile.Orientation = Vector3.new(0,90,0)
- end
- Sparkle(Missile,Color3.new(0,255,255))
- local BodyVelocity = Instance.new("BodyVelocity",Missile)
- BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- BodyVelocity.Velocity = Vector3.new(Missile.CFrame.LookVector.X*10,Missile.CFrame.LookVector.Y*10,Missile.CFrame.LookVector.Z*10)
- game.Debris:AddItem(Missile,5)
- coroutine.resume(coroutine.create(function()
- Missile.Touched:Connect(function(Hit)
- if Hit.Parent and Hit.Parent == Character and Hit.Parent.Humanoid.Health > 0 then
- Character:BreakJoints()
- EndGame()
- local Effect = Instance.new("Part",workspace)
- Effect.CFrame = CFrame.new(Missile.Position)
- Missile:Destroy()
- Effect.CanCollide = false
- Effect.Anchored = true
- Effect.Locked = true
- Effect.Shape = Enum.PartType.Ball
- Effect.BrickColor = BrickColor.new("Teal")
- Effect.Material = Enum.Material.Neon
- Effect.Size = Vector3.new(20,20,20)
- Effect.TopSurface = Enum.SurfaceType.Smooth
- Effect.BottomSurface = Enum.SurfaceType.Smooth
- local Sound = Instance.new("Sound",Effect)
- Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
- Sound.PlaybackSpeed = 3
- Sound.Volume = 3
- Sound:Play()
- for i = 1,20 do
- wait(.025)
- Effect.Transparency = Effect.Transparency+.05
- end
- Effect:Destroy()
- end
- end)
- end))
- end
- function DifficultyLevel3Obstacle()
- local LastBoundaryHit = nil
- local Projectile = Instance.new("Part",Plate)
- Projectile.Name = "Bouncing Projectile"
- Projectile.Shape = Enum.PartType.Ball
- Projectile.CanCollide = false
- Projectile.BrickColor = BrickColor.new("Magenta")
- Projectile.Material = Enum.Material.Neon
- Projectile.CFrame = CFrame.new(8,2.25,-45.25)
- Projectile.Size = Vector3.new(2.5,2.5,2.5)
- Projectile.TopSurface = Enum.SurfaceType.Smooth
- Projectile.BottomSurface = Enum.SurfaceType.Smooth
- Projectile.Orientation = Vector3.new(0,30,0)
- local BodyVelocity = Instance.new("BodyVelocity",Projectile)
- BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- BodyVelocity.Velocity = Vector3.new(Projectile.CFrame.LookVector.X*15,Projectile.CFrame.LookVector.Y*15,Projectile.CFrame.LookVector.Z*15)
- local function Bounce()
- Sparkle(Projectile,Color3.fromRGB(170,0,170))
- Projectile.Orientation = Vector3.new(Projectile.Orientation.X,Projectile.Orientation.Y+90,Projectile.Orientation.Z)
- BodyVelocity.Velocity = Vector3.new(Projectile.CFrame.LookVector.X*15,Projectile.CFrame.LookVector.Y*15,Projectile.CFrame.LookVector.Z*15)
- end
- Projectile.Touched:Connect(function(Hit)
- if Hit.Parent and Hit.Parent == Character then
- Character:BreakJoints()
- EndGame()
- local Effect = Instance.new("Part",workspace)
- Effect.CFrame = CFrame.new(Projectile.Position)
- Projectile:Destroy()
- Effect.CanCollide = false
- Effect.Anchored = true
- Effect.Locked = true
- Effect.Shape = Enum.PartType.Ball
- Effect.BrickColor = BrickColor.new("Magenta")
- Effect.Material = Enum.Material.Neon
- Effect.Size = Vector3.new(20,20,20)
- Effect.TopSurface = Enum.SurfaceType.Smooth
- Effect.BottomSurface = Enum.SurfaceType.Smooth
- local Sound = Instance.new("Sound",Effect)
- Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
- Sound.PlaybackSpeed = 3
- Sound.Volume = 3
- Sound:Play()
- for i = 1,20 do
- wait(.025)
- Effect.Transparency = Effect.Transparency+.05
- end
- Effect:Destroy()
- elseif Hit.Parent and Hit.Name:sub(1,8) == "Boundary" then
- if LastBoundaryHit ~= nil and LastBoundaryHit ~= Hit.Name then
- LastBoundaryHit = Hit.Name
- Bounce()
- elseif LastBoundaryHit == nil then
- LastBoundaryHit = Hit.Name
- Bounce()
- end
- end
- end)
- end
- function IncreaseDifficultyLevel()
- DifficultyLevel = DifficultyLevel+1
- if DifficultyLevel == 2 then
- Announce("Difficulty Level 2",Color3.fromRGB(0,255,255))
- elseif DifficultyLevel == 3 then
- Announce("Difficulty Level 3",Color3.fromRGB(0,0,255))
- DifficultyLevel3Obstacle()
- elseif DifficultyLevel == 4 then
- Announce("Difficulty Level 4",Color3.fromRGB(255,0,5))
- elseif DifficultyLevel == 5 then
- Announce("MAXIMUM DIFFICULTY!",Color3.fromRGB(255,0,0))
- end
- end
- -- Loops
- coroutine.resume(coroutine.create(function()
- while wait(1) do
- if GameEnd then return end
- CreateMissile()
- end
- end))
- coroutine.resume(coroutine.create(function()
- while wait(15) do
- if GameEnd then return end
- if DifficultyLevel <= 4 then
- IncreaseDifficultyLevel()
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while wait(1) do
- if GameEnd then return end
- Time = Time+1
- Timer.Text = ("Time Survived: "..Time.." Seconds")
- end
- end))
- coroutine.resume(coroutine.create(function()
- while wait(2) do
- if GameEnd then return end
- if DifficultyLevel >= 2 then
- local Alert = Instance.new("Part",Plate)
- Alert.Name = "Alert"
- Alert.Size = Vector3.new(5,.05,5)
- Alert.CanCollide = false
- Alert.Anchored = true
- Alert.Material = Enum.Material.Neon
- Alert.BrickColor = BrickColor.new("Really red")
- Alert.TopSurface = Enum.SurfaceType.Smooth
- Alert.BottomSurface = Enum.SurfaceType.Smooth
- Alert.Transparency = 0.5
- Alert.CFrame = CFrame.new(Character.HumanoidRootPart.Position.X,1.025,Character.HumanoidRootPart.Position.Z)
- Sparkle(Alert,Color3.fromRGB(255,0,0))
- local Sound = Instance.new("Sound",Alert)
- Sound.SoundId = "rbxasset://sounds\\electronicpingshort.wav"
- Sound.Volume = 2
- Sound:Play()
- local SurfaceGui = Instance.new("SurfaceGui",Alert)
- SurfaceGui.LightInfluence = 0
- SurfaceGui.Face = Enum.NormalId.Top
- SurfaceGui.AlwaysOnTop = true
- local TextLabel = Instance.new("TextBox",SurfaceGui)
- TextLabel.Size = UDim2.new(1,0,1,0)
- TextLabel.BackgroundTransparency = 1
- TextLabel.Font = Enum.Font.Arcade
- TextLabel.TextStrokeTransparency = 0
- TextLabel.TextColor3 = Color3.fromRGB(0,255,0)
- TextLabel.TextScaled = true
- TextLabel.Text = "3"
- local function Explode()
- local Effect = Instance.new("Part",workspace)
- Effect.CFrame = CFrame.new(Alert.Position)
- Alert:Destroy()
- Effect.CanCollide = false
- Effect.Anchored = true
- Effect.Locked = true
- Effect.Shape = Enum.PartType.Ball
- Effect.BrickColor = BrickColor.new("Really red")
- Effect.Material = Enum.Material.Neon
- Effect.Size = Vector3.new(5,5,5)
- Effect.TopSurface = Enum.SurfaceType.Smooth
- Effect.BottomSurface = Enum.SurfaceType.Smooth
- local Connection = Effect.Touched:Connect(function() end)
- local Sound = Instance.new("Sound",Effect)
- Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
- Sound.PlaybackSpeed = 3
- Sound.Volume = 3
- Sound:Play()
- for i,v in pairs(Effect:GetTouchingParts()) do
- if v.Parent and v.Parent == Character then
- Character:BreakJoints()
- EndGame()
- end
- end
- coroutine.resume(coroutine.create(function()
- for i = 1,20 do
- wait(.025)
- Effect.Transparency = Effect.Transparency+.05
- end
- end))
- end
- coroutine.resume(coroutine.create(function()
- for i = 1,3 do
- wait(1)
- if GameEnd then return end
- if i == 1 then
- TextLabel.Text = "2"
- TextLabel.TextColor3 = Color3.fromRGB(255,255,0)
- elseif i == 2 then
- TextLabel.Text = "1"
- TextLabel.TextColor3 = Color3.fromRGB(255,0,0)
- elseif i == 3 then
- Explode()
- end
- Sound:Play()
- end
- end))
- end
- end
- end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement