Advertisement
fusionfriends

Survive the plate of doom

Nov 19th, 2019
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.72 KB | None | 0 0
  1. local Player = owner
  2. repeat wait() until Player.Character
  3. local Character = Player.Character
  4. -- Setting up variables and ect
  5. local DifficultyLevel = 1
  6. local Time = 0
  7. local GameEnd = false
  8. local Plate = Instance.new("Part",workspace)
  9. Plate.Size = Vector3.new(30,1,30)
  10. Plate.CFrame = CFrame.new(-3.75,0.5,-57.5)
  11. Plate.Anchored = true
  12. Plate.TopSurface = Enum.SurfaceType.Smooth
  13. Plate.BottomSurface = Enum.SurfaceType.Smooth
  14. Plate.Locked = true
  15. Plate.Name = "Plate"
  16. local BillboardGui = Instance.new("BillboardGui",Plate)
  17. BillboardGui.LightInfluence = 0
  18. BillboardGui.StudsOffset = Vector3.new(0,25,0)
  19. BillboardGui.Size = UDim2.new(15,0,7.5,0)
  20. local Annoucements = Instance.new("TextBox",BillboardGui)
  21. Annoucements.BackgroundTransparency = 1
  22. Annoucements.TextStrokeTransparency = 0
  23. Annoucements.Font = Enum.Font.Arcade
  24. Annoucements.Size = UDim2.new(1,0,0.5,0)
  25. Annoucements.TextScaled = true
  26. local Timer = Instance.new("TextBox",BillboardGui)
  27. Timer.BackgroundTransparency = 1
  28. Timer.TextStrokeTransparency = 0
  29. Timer.Font = Enum.Font.Arcade
  30. Timer.TextScaled = true
  31. Timer.Position = UDim2.new(0,0,0.5,0)
  32. Timer.Size = UDim2.new(1,0,0.5,0)
  33. Timer.TextColor3 = Color3.fromRGB(255,255,255)
  34. local Boundary1 = Plate:Clone()
  35. Boundary1:ClearAllChildren()
  36. Boundary1.Parent = workspace
  37. Boundary1.Transparency = 1
  38. Boundary1.CFrame = CFrame.new(-19.25,15,-57.5)
  39. Boundary1.Orientation = Vector3.new(-90,90,0)
  40. Boundary1.Name = "Boundary1"
  41. local Boundary2 = Boundary1:Clone()
  42. Boundary2.Parent = workspace
  43. Boundary2.CFrame = CFrame.new(-3.75,15,-42)
  44. Boundary2.Orientation = Vector3.new(-90,0,0)
  45. Boundary2.Name = "Boundary2"
  46. local Boundary3 = Boundary1:Clone()
  47. Boundary3.Parent = workspace
  48. Boundary3.CFrame = CFrame.new(-3.75,15,-73)
  49. Boundary3.Orientation = Vector3.new(-90,0,0)
  50. Boundary3.Name = "Boundary3"
  51. local Boundary4 = Boundary1:Clone()
  52. Boundary4.Parent = workspace
  53. Boundary4.CFrame = CFrame.new(11.75,15,-57.5)
  54. Boundary4.Orientation = Vector3.new(-90,90,0)
  55. Boundary4.Name = "Boundary4"
  56. local Boundary5 = Boundary1:Clone()
  57. Boundary5.Parent = workspace
  58. Boundary5.CFrame = CFrame.new(-3.75,29.5,-57.5)
  59. Boundary5.Orientation = Vector3.new(0,0,0)
  60. Boundary5.Name = "Boundary5"
  61. Character.HumanoidRootPart.CFrame = CFrame.new(Plate.Position.X,Plate.Position.Y+2,Plate.Position.Z)
  62. -- Functions
  63. function EndGame()
  64.     coroutine.resume(coroutine.create(function()
  65.         GameEnd = true
  66.         for i,v in pairs(Plate:GetChildren()) do
  67.             wait(.1)
  68.             if v:IsA("Part") then
  69.                 Sparkle(v,Color3.fromRGB(255,255,255))
  70.                 v:Destroy()
  71.             end
  72.         end
  73.         Announce("Survived "..Time.." Seconds!",Color3.fromRGB(255,255,0))
  74.         Timer:Destroy()
  75.         local Sound = Instance.new("Sound",Plate)
  76.         Sound.SoundId = "rbxasset://sounds/bass.wav"
  77.         Sound.PlaybackSpeed = 3
  78.         Sound.Volume = 2
  79.         coroutine.resume(coroutine.create(function()
  80.             for i = 1,50 do
  81.                 wait(.1)
  82.                 if Annoucements.TextColor3 == Color3.fromRGB(255,255,0) then
  83.                     Annoucements.TextColor3 = Color3.fromRGB(255,0,0)
  84.                     Sound:Play()
  85.                 elseif Annoucements.TextColor3 == Color3.fromRGB(255,0,0) then
  86.                     Annoucements.TextColor3 = Color3.fromRGB(255,255,0)
  87.                 end
  88.             end
  89.         end))
  90.         wait(5)
  91.         Plate:Destroy()
  92.         Boundary1:Destroy()
  93.         Boundary2:Destroy()
  94.         Boundary3:Destroy()
  95.         Boundary4:Destroy()
  96.         Boundary5:Destroy()
  97.         script:Destroy()
  98.     end))
  99. end
  100. function Announce(Message,Color)
  101.     Annoucements.Text = Message
  102.     Annoucements.TextColor3 = Color
  103.     local Sound = Instance.new("Sound",Plate)
  104.     Sound.SoundId = "rbxasset://sounds/bass.wav"
  105.     Sound.Volume = 3
  106.     Sound:Play()
  107. end
  108. Announce("Difficulty Level 1",Color3.new(0,255,0))
  109. function Sparkle(Object,Color)
  110.     local Part = Instance.new("Part",workspace)
  111.     Part.CanCollide = false
  112.     Part.Anchored = true
  113.     Part.CFrame = Object.CFrame
  114.     Part.Transparency = 1
  115.     Part.Size = Vector3.new(.25,.25,.25)
  116.     Part.Locked = true
  117.     local Sound = Instance.new("Sound",Part)
  118.     Sound.SoundId = "rbxasset://sounds/snap.mp3"
  119.     Sound.Volume = 1
  120.     Sound:Play()
  121.     local ParticleEmitter = Instance.new("ParticleEmitter",Part)
  122.     ParticleEmitter.Lifetime = NumberRange.new(1)
  123.     ParticleEmitter.Color = ColorSequence.new(Color)
  124.     ParticleEmitter.Drag = 10
  125.     ParticleEmitter.SpreadAngle = Vector2.new(5000,5000)
  126.     ParticleEmitter.Speed = NumberRange.new(20)
  127.     ParticleEmitter.Enabled = false
  128.     ParticleEmitter:Emit(10)
  129.     game.Debris:AddItem(Part,1)
  130.     return Part
  131. end
  132. function CreateMissile()
  133.     local Missile = Instance.new("Part",Plate)
  134.     Missile.Name = "Missile"
  135.     Missile.Locked = true
  136.     Missile.CanCollide = false
  137.     Missile.BrickColor = BrickColor.new("Toothpaste")
  138.     Missile.Material = Enum.Material.Neon
  139.     Missile.TopSurface = Enum.SurfaceType.Smooth
  140.     Missile.BottomSurface = Enum.SurfaceType.Smooth
  141.     Missile.Size = Vector3.new(1,1,4)
  142.     local RandomSide = math.random(1,4)
  143.     if RandomSide == 1 then
  144.         Missile.CFrame = CFrame.new(math.random(-4,4),0,20)*Character.HumanoidRootPart.CFrame
  145.         Missile.Orientation = Vector3.new(0,0,0)
  146.     elseif RandomSide == 2 then
  147.         Missile.CFrame = CFrame.new(math.random(-4,4),0,-20)*Character.HumanoidRootPart.CFrame
  148.         Missile.Orientation = Vector3.new(0,180,0)
  149.     elseif RandomSide == 3 then
  150.         Missile.CFrame = CFrame.new(-20,0,math.random(-4,4))*Character.HumanoidRootPart.CFrame
  151.         Missile.Orientation = Vector3.new(0,-90,0)
  152.     elseif RandomSide == 4 then
  153.         Missile.CFrame = CFrame.new(20,0,math.random(-4,4))*Character.HumanoidRootPart.CFrame
  154.         Missile.Orientation = Vector3.new(0,90,0)
  155.     end
  156.     Sparkle(Missile,Color3.new(0,255,255))
  157.     local BodyVelocity = Instance.new("BodyVelocity",Missile)
  158.     BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  159.     BodyVelocity.Velocity = Vector3.new(Missile.CFrame.LookVector.X*10,Missile.CFrame.LookVector.Y*10,Missile.CFrame.LookVector.Z*10)
  160.     game.Debris:AddItem(Missile,5)
  161.     coroutine.resume(coroutine.create(function()
  162.         Missile.Touched:Connect(function(Hit)
  163.             if Hit.Parent and Hit.Parent == Character and Hit.Parent.Humanoid.Health > 0 then
  164.                 Character:BreakJoints()
  165.                 EndGame()
  166.                 local Effect = Instance.new("Part",workspace)
  167.                 Effect.CFrame = CFrame.new(Missile.Position)
  168.                 Missile:Destroy()
  169.                 Effect.CanCollide = false
  170.                 Effect.Anchored = true
  171.                 Effect.Locked = true
  172.                 Effect.Shape = Enum.PartType.Ball
  173.                 Effect.BrickColor = BrickColor.new("Teal")
  174.                 Effect.Material = Enum.Material.Neon
  175.                 Effect.Size = Vector3.new(20,20,20)
  176.                 Effect.TopSurface = Enum.SurfaceType.Smooth
  177.                 Effect.BottomSurface = Enum.SurfaceType.Smooth
  178.                 local Sound = Instance.new("Sound",Effect)
  179.                 Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
  180.                 Sound.PlaybackSpeed = 3
  181.                 Sound.Volume = 3
  182.                 Sound:Play()
  183.                 for i = 1,20 do
  184.                     wait(.025)
  185.                     Effect.Transparency = Effect.Transparency+.05
  186.                 end
  187.                 Effect:Destroy()
  188.             end
  189.         end)
  190.     end))
  191. end
  192. function DifficultyLevel3Obstacle()
  193.     local LastBoundaryHit = nil
  194.     local Projectile = Instance.new("Part",Plate)
  195.     Projectile.Name = "Bouncing Projectile"
  196.     Projectile.Shape = Enum.PartType.Ball
  197.     Projectile.CanCollide = false
  198.     Projectile.BrickColor = BrickColor.new("Magenta")
  199.     Projectile.Material = Enum.Material.Neon
  200.     Projectile.CFrame = CFrame.new(8,2.25,-45.25)
  201.     Projectile.Size = Vector3.new(2.5,2.5,2.5)
  202.     Projectile.TopSurface = Enum.SurfaceType.Smooth
  203.     Projectile.BottomSurface = Enum.SurfaceType.Smooth
  204.     Projectile.Orientation = Vector3.new(0,30,0)
  205.     local BodyVelocity = Instance.new("BodyVelocity",Projectile)
  206.     BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  207.     BodyVelocity.Velocity = Vector3.new(Projectile.CFrame.LookVector.X*15,Projectile.CFrame.LookVector.Y*15,Projectile.CFrame.LookVector.Z*15)
  208.     local function Bounce()
  209.         Sparkle(Projectile,Color3.fromRGB(170,0,170))
  210.         Projectile.Orientation = Vector3.new(Projectile.Orientation.X,Projectile.Orientation.Y+90,Projectile.Orientation.Z)
  211.         BodyVelocity.Velocity = Vector3.new(Projectile.CFrame.LookVector.X*15,Projectile.CFrame.LookVector.Y*15,Projectile.CFrame.LookVector.Z*15)
  212.     end
  213.     Projectile.Touched:Connect(function(Hit)
  214.         if Hit.Parent and Hit.Parent == Character then
  215.             Character:BreakJoints()
  216.             EndGame()
  217.             local Effect = Instance.new("Part",workspace)
  218.             Effect.CFrame = CFrame.new(Projectile.Position)
  219.             Projectile:Destroy()
  220.             Effect.CanCollide = false
  221.             Effect.Anchored = true
  222.             Effect.Locked = true
  223.             Effect.Shape = Enum.PartType.Ball
  224.             Effect.BrickColor = BrickColor.new("Magenta")
  225.             Effect.Material = Enum.Material.Neon
  226.             Effect.Size = Vector3.new(20,20,20)
  227.             Effect.TopSurface = Enum.SurfaceType.Smooth
  228.             Effect.BottomSurface = Enum.SurfaceType.Smooth
  229.             local Sound = Instance.new("Sound",Effect)
  230.             Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
  231.             Sound.PlaybackSpeed = 3
  232.             Sound.Volume = 3
  233.             Sound:Play()
  234.             for i = 1,20 do
  235.                 wait(.025)
  236.                 Effect.Transparency = Effect.Transparency+.05
  237.             end
  238.             Effect:Destroy()
  239.         elseif Hit.Parent and Hit.Name:sub(1,8) == "Boundary" then
  240.             if LastBoundaryHit ~= nil and LastBoundaryHit ~= Hit.Name then
  241.                 LastBoundaryHit = Hit.Name
  242.                 Bounce()
  243.             elseif LastBoundaryHit == nil then
  244.                 LastBoundaryHit = Hit.Name
  245.                 Bounce()
  246.             end
  247.         end
  248.     end)
  249. end
  250. function IncreaseDifficultyLevel()
  251.     DifficultyLevel = DifficultyLevel+1
  252.     if DifficultyLevel == 2 then
  253.         Announce("Difficulty Level 2",Color3.fromRGB(0,255,255))
  254.     elseif DifficultyLevel == 3 then
  255.         Announce("Difficulty Level 3",Color3.fromRGB(0,0,255))
  256.         DifficultyLevel3Obstacle()
  257.     elseif DifficultyLevel == 4 then
  258.         Announce("Difficulty Level 4",Color3.fromRGB(255,0,5))
  259.     elseif DifficultyLevel == 5 then
  260.         Announce("MAXIMUM DIFFICULTY!",Color3.fromRGB(255,0,0))
  261.     end
  262. end
  263. -- Loops
  264. coroutine.resume(coroutine.create(function()
  265.     while wait(1) do
  266.         if GameEnd then return end
  267.         CreateMissile()
  268.     end
  269. end))
  270. coroutine.resume(coroutine.create(function()
  271.     while wait(15) do
  272.         if GameEnd then return end
  273.         if DifficultyLevel <= 4 then
  274.             IncreaseDifficultyLevel()
  275.         end
  276.     end
  277. end))
  278. coroutine.resume(coroutine.create(function()
  279.     while wait(1) do
  280.         if GameEnd then return end
  281.         Time = Time+1
  282.         Timer.Text = ("Time Survived: "..Time.." Seconds")
  283.     end
  284. end))
  285. coroutine.resume(coroutine.create(function()
  286.     while wait(2) do
  287.         if GameEnd then return end
  288.         if DifficultyLevel >= 2 then
  289.             local Alert = Instance.new("Part",Plate)
  290.             Alert.Name = "Alert"
  291.             Alert.Size = Vector3.new(5,.05,5)
  292.             Alert.CanCollide = false
  293.             Alert.Anchored = true
  294.             Alert.Material = Enum.Material.Neon
  295.             Alert.BrickColor = BrickColor.new("Really red")
  296.             Alert.TopSurface = Enum.SurfaceType.Smooth
  297.             Alert.BottomSurface = Enum.SurfaceType.Smooth
  298.             Alert.Transparency = 0.5
  299.             Alert.CFrame = CFrame.new(Character.HumanoidRootPart.Position.X,1.025,Character.HumanoidRootPart.Position.Z)
  300.             Sparkle(Alert,Color3.fromRGB(255,0,0))
  301.             local Sound = Instance.new("Sound",Alert)
  302.             Sound.SoundId = "rbxasset://sounds\\electronicpingshort.wav"
  303.             Sound.Volume = 2
  304.             Sound:Play()
  305.             local SurfaceGui = Instance.new("SurfaceGui",Alert)
  306.             SurfaceGui.LightInfluence = 0
  307.             SurfaceGui.Face = Enum.NormalId.Top
  308.             SurfaceGui.AlwaysOnTop = true
  309.             local TextLabel = Instance.new("TextBox",SurfaceGui)
  310.             TextLabel.Size = UDim2.new(1,0,1,0)
  311.             TextLabel.BackgroundTransparency = 1
  312.             TextLabel.Font = Enum.Font.Arcade
  313.             TextLabel.TextStrokeTransparency = 0
  314.             TextLabel.TextColor3 = Color3.fromRGB(0,255,0)
  315.             TextLabel.TextScaled = true
  316.             TextLabel.Text = "3"
  317.             local function Explode()
  318.                 local Effect = Instance.new("Part",workspace)
  319.                 Effect.CFrame = CFrame.new(Alert.Position)
  320.                 Alert:Destroy()
  321.                 Effect.CanCollide = false
  322.                 Effect.Anchored = true
  323.                 Effect.Locked = true
  324.                 Effect.Shape = Enum.PartType.Ball
  325.                 Effect.BrickColor = BrickColor.new("Really red")
  326.                 Effect.Material = Enum.Material.Neon
  327.                 Effect.Size = Vector3.new(5,5,5)
  328.                 Effect.TopSurface = Enum.SurfaceType.Smooth
  329.                 Effect.BottomSurface = Enum.SurfaceType.Smooth
  330.                 local Connection = Effect.Touched:Connect(function() end)
  331.                 local Sound = Instance.new("Sound",Effect)
  332.                 Sound.SoundId = "rbxasset://sounds/impact_explosion_03.mp3"
  333.                 Sound.PlaybackSpeed = 3
  334.                 Sound.Volume = 3
  335.                 Sound:Play()
  336.                 for i,v in pairs(Effect:GetTouchingParts()) do
  337.                     if v.Parent and v.Parent == Character then
  338.                         Character:BreakJoints()
  339.                         EndGame()
  340.                     end
  341.                 end
  342.                 coroutine.resume(coroutine.create(function()
  343.                     for i = 1,20 do
  344.                         wait(.025)
  345.                         Effect.Transparency = Effect.Transparency+.05
  346.                     end
  347.                 end))
  348.             end
  349.             coroutine.resume(coroutine.create(function()
  350.                 for i = 1,3 do
  351.                     wait(1)
  352.                     if GameEnd then return end
  353.                     if i == 1 then
  354.                         TextLabel.Text = "2"
  355.                         TextLabel.TextColor3 = Color3.fromRGB(255,255,0)
  356.                     elseif i == 2 then
  357.                         TextLabel.Text = "1"
  358.                         TextLabel.TextColor3 = Color3.fromRGB(255,0,0)
  359.                     elseif i == 3 then
  360.                         Explode()
  361.                     end
  362.                     Sound:Play()
  363.                 end
  364.             end))
  365.         end
  366.     end
  367. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement