Advertisement
it6318

Roblox Boss Fight Script

Nov 10th, 2020
4,545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.67 KB | None | 0 0
  1.  
  2. local Area = script.Parent.Insidebattle
  3.  
  4. Area.Touched:Connect(function() end) -- Just for a TouchInterest to occur on a CanCollide false part
  5.  
  6.  
  7. function CheckIfPlayerIsInArea(Part)
  8.     local touching = Part:GetTouchingParts()
  9.     for i,val in pairs(touching) do
  10.         if val.Parent.ClassName == "Model" then
  11.             if val.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  12.                 if val.Parent:FindFirstChildOfClass("Humanoid").Name ~= "Zombie" then
  13.                     return true
  14.                 end
  15.             end
  16.         end
  17.     end
  18.     return false
  19. end
  20.  
  21.  
  22.  
  23.  
  24. local TweenService = game:GetService("TweenService")
  25. db = false
  26.  
  27. local function ResetBossFight()
  28.     --L1                                                                            --LEVEL 1
  29.     script.Parent.L1R.Position = Vector3.new(-69, 41.25, -19.5)
  30.     script.Parent.L1R.Material = Enum.Material.WoodPlanks
  31.     script.Parent.L1R.Anchored = true
  32.     script.Parent.L1R.CanCollide = false
  33.     script.Parent.L1R.Transparency = 1
  34.     script.Parent.MoL1.Position = Vector3.new(-69, 39, -34)
  35.     script.Parent.MoL1.Transparency = 1
  36.     script.Parent.MoL1.OOF.Disabled = true
  37.     --L2                                                                            --LEVEL 2
  38.     script.Parent.L2Y.Position = Vector3.new(-58.575, 43.25, -23.575)
  39.     script.Parent.L2Y.Material = Enum.Material.WoodPlanks
  40.     script.Parent.L2Y.Anchored = true
  41.     script.Parent.L2Y.CanCollide = false
  42.     script.Parent.L2Y.Transparency = 1
  43.     script.Parent.MoL2.Position = Vector3.new(-69, 38.88, -34)
  44.     script.Parent.MoL2.Transparency = 1
  45.     script.Parent.MoL2.OOF.Disabled = true
  46.     script.Parent.MoL2.Size = Vector3.new(7, 0.75, 7)
  47.     --L3
  48.     script.Parent.L3G.Position = Vector3.new(-54.5, 45.25, -34)
  49.     script.Parent.L3G.Material = Enum.Material.WoodPlanks
  50.     script.Parent.L3G.Anchored = true
  51.     script.Parent.L3G.CanCollide = false
  52.     script.Parent.L3G.Transparency = 1
  53.     script.Parent.FireBall1.Position = Vector3.new(-69, 73.25, -24)
  54.     script.Parent.FireBall2.Position = Vector3.new(-59, 73.25, -34)
  55.     script.Parent.FireBall3.Position = Vector3.new(-69, 73.25, -44)
  56.     script.Parent.FireBall4.Position = Vector3.new(-79, 73.25, -34)
  57.     --L4
  58.     script.Parent.L4B.Position = Vector3.new(-58.575, 47.25, -44.425)
  59.     script.Parent.L4B.Material = Enum.Material.WoodPlanks
  60.     script.Parent.L4B.Anchored = true
  61.     script.Parent.L4B.CanCollide = false
  62.     script.Parent.L4B.Transparency = 1 
  63.     --L5
  64.     script.Parent.L5P.Position = Vector3.new(-69, 49.25, -48.5)
  65.     script.Parent.L5P.Material = Enum.Material.WoodPlanks
  66.     script.Parent.L5P.Anchored = true
  67.     script.Parent.L5P.CanCollide = false
  68.     script.Parent.L5P.Transparency = 1 
  69.     --end
  70.     script.Parent.protection.backtx.Transparency = 1
  71.     script.Parent.protection.lefttx.Transparency = 1
  72.     script.Parent.protection.fronttx.Transparency = 1
  73.     script.Parent.protection.righttx.Transparency = 1
  74.     script.Parent.Parent.MegaSquadMo.Head.face.Texture = "rbxassetid://5941521724"
  75.     script.Parent.exit.Script.Disabled = true
  76.     script.Parent.exit.Sparkles.Enabled = false
  77.     script.Parent.exit.face.Transparency = 1
  78.     script.Parent.exit.logo.Transparency = 1
  79.     script.Parent.exit.Transparency = 1
  80.     script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = true
  81.     wait(1.5)
  82.     script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = false
  83.     wait(5)
  84.     db = false
  85. end
  86.  
  87. game.Workspace.ObbyStructure.L14.MegaSquadMo.Rotationscript.Disabled = true
  88.  
  89. script.Parent.Insidebattle.Touched:Connect(function(hit)
  90.     if db == false then
  91.         db = true
  92.         if CheckIfPlayerIsInArea(Area) == false then --check to see if player is in mingame
  93.             script.Parent.Door.HingeConstraint.AngularVelocity = 1
  94.             print(CheckIfPlayerIsInArea(Area))
  95.             wait(3)
  96.             db = false
  97.         else
  98.             print(CheckIfPlayerIsInArea(Area))
  99.             script.Parent.Door.HingeConstraint.AngularVelocity = -1
  100.             script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = true
  101.             wait(1.5)
  102.             script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = false
  103.             --start L1                                                                          --LEVEL 1
  104.             wait(3)
  105.             local MoL1 = script.Parent:FindFirstChild("MoL1")
  106.             local L1OOF = MoL1:FindFirstChild("OOF")
  107.             local L1R = script.Parent:FindFirstChild("L1R")
  108.             local Rotecount = 0
  109.            
  110.             local info1 = TweenInfo.new(
  111.                 10,
  112.                 Enum.EasingStyle.Linear,
  113.                 Enum.EasingDirection.Out,
  114.                 0,
  115.                 false,
  116.                 0  
  117.             )
  118.            
  119.             local infocomplete1 = TweenInfo.new(
  120.                 2,
  121.                 Enum.EasingStyle.Circular,
  122.                 Enum.EasingDirection.Out,
  123.                 0,
  124.                 false,
  125.                 0  
  126.             )
  127.            
  128.             local goal1 = {Orientation = Vector3.new(0, 360, 0)}
  129.             local goalcomplete1 = {Position = Vector3.new(-69, 41.25, -27.5)}
  130.             local rotateparttween = TweenService:Create(MoL1, info1, goal1)
  131.             local completetween = TweenService:Create(L1R, infocomplete1, goalcomplete1)
  132.            
  133.             --scriptstart
  134.             MoL1.Transparency = 0.35
  135.             L1OOF.Disabled = false
  136.             wait(1.5)
  137.             repeat
  138.                 rotateparttween:play()
  139.                 rotateparttween.Completed:wait()
  140.                 Rotecount = Rotecount + 1
  141.                 print(Rotecount)
  142.             until Rotecount == 4
  143.             L1OOF.Disabled = true
  144.             MoL1.Transparency = 1
  145.             wait(1.5) -- add player check here
  146.            
  147.             if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  148.                 Rotecount = 0
  149.                 ResetBossFight()
  150.                 script.Parent.Door.HingeConstraint.AngularVelocity = 1
  151.             else
  152.                 script.Parent.Door.HingeConstraint.AngularVelocity = -1
  153.                 local ClickDetector = Instance.new("ClickDetector")
  154.                 ClickDetector.Parent = L1R
  155.                 ClickDetector.MaxActivationDistance = 32
  156.                 local CDt = L1R:WaitForChild("ClickDetector")
  157.                 L1R.Transparency = 0.35
  158.                 CDt.MouseClick:Connect(function()
  159.                     CDt:Destroy()
  160.                     L1R.Anchored = false
  161.                     completetween:play()
  162.                    
  163.                     --L1R.CanCollide = true
  164.                 end)
  165.                 Rotecount = 0
  166.                 completetween.Completed:wait()
  167.                 L1R.Anchored = true
  168.                 L1R.Transparency = 0
  169.                
  170.                 if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  171.                     ResetBossFight()
  172.                     script.Parent.Door.HingeConstraint.AngularVelocity = 1
  173.                 else
  174.                     script.Parent.Door.HingeConstraint.AngularVelocity = -1
  175.                    
  176.                     --start L2                                                                  --LEVEL 2
  177.                     wait(3)
  178.                     local MoL2 = script.Parent:FindFirstChild("MoL2")
  179.                     local L2OOF = MoL2:FindFirstChild("OOF")
  180.                     local L2Y = script.Parent:FindFirstChild("L2Y")
  181.                     local Growcount = 0
  182.                    
  183.                     local info2 = TweenInfo.new(
  184.                         5,
  185.                         Enum.EasingStyle.Quint,
  186.                         Enum.EasingDirection.InOut,
  187.                         0,
  188.                         true,
  189.                         0  
  190.                     )
  191.                    
  192.                     local infocomplete2 = TweenInfo.new(
  193.                         2,
  194.                         Enum.EasingStyle.Circular,
  195.                         Enum.EasingDirection.Out,
  196.                         0,
  197.                         false,
  198.                         0  
  199.                     )
  200.                    
  201.                     local goal2 = {Size = Vector3.new(35, 0.75, 35)}
  202.                     local goalcomplete2 = {Position = Vector3.new(-64.232, 43.25, -29.232)}
  203.                     local growparttween = TweenService:Create(MoL2, info2, goal2)
  204.                     local completetween2 = TweenService:Create(L2Y, infocomplete2, goalcomplete2)
  205.                    
  206.                     --scriptstart
  207.                     MoL2.Transparency = 0.35
  208.                     L2OOF.Disabled = false
  209.                     wait(1.5)
  210.                     repeat
  211.                         growparttween:play()
  212.                         growparttween.Completed:wait()
  213.                         Growcount = Growcount + 1
  214.                         print(Growcount)
  215.                     until Growcount == 4
  216.                     L2OOF.Disabled = true
  217.                     MoL2.Transparency = 1
  218.                     wait(1.5) -- add player check here
  219.                    
  220.                     if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  221.                         Growcount = 0
  222.                         Rotecount = 0
  223.                         ResetBossFight()
  224.                         script.Parent.Door.HingeConstraint.AngularVelocity = 1
  225.                     else
  226.                         script.Parent.Door.HingeConstraint.AngularVelocity = -1
  227.                         local ClickDetector = Instance.new("ClickDetector")
  228.                         ClickDetector.Parent = L2Y
  229.                         ClickDetector.MaxActivationDistance = 32
  230.                         local CDt = L2Y:WaitForChild("ClickDetector")
  231.                         L2Y.Transparency = 0.35
  232.                         CDt.MouseClick:Connect(function()
  233.                             CDt:Destroy()
  234.                             L2Y.Anchored = false
  235.                             completetween2:play()
  236.                            
  237.                             --L1R.CanCollide = true
  238.                         end)
  239.                         Growcount = 0
  240.                         Rotecount = 0
  241.                         completetween2.Completed:wait()
  242.                         L2Y.Anchored = true
  243.                         L2Y.Transparency = 0
  244.                        
  245.                         if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  246.                             ResetBossFight()
  247.                             script.Parent.Door.HingeConstraint.AngularVelocity = 1
  248.                         else
  249.                             script.Parent.Door.HingeConstraint.AngularVelocity = -1
  250.                            
  251.                             --start L3                                                          --LEVEL 3
  252.                             wait(3)
  253.                             local FB1 = script.Parent:FindFirstChild("FireBall1")
  254.                             local FB2 = script.Parent:FindFirstChild("FireBall2")
  255.                             local FB3 = script.Parent:FindFirstChild("FireBall3")
  256.                             local FB4 = script.Parent:FindFirstChild("FireBall4")
  257.                             local FB1OOF = FB1:FindFirstChild("OOF")
  258.                             local FB2OOF = FB2:FindFirstChild("OOF")
  259.                             local FB3OOF = FB3:FindFirstChild("OOF")
  260.                             local FB4OOF = FB4:FindFirstChild("OOF")
  261.                             local M1 = script.Parent:FindFirstChild("Marker1")
  262.                             local M2 = script.Parent:FindFirstChild("Marker2")
  263.                             local M3 = script.Parent:FindFirstChild("Marker3")
  264.                             local M4 = script.Parent:FindFirstChild("Marker4")
  265.                             local M1OOF = M1:FindFirstChild("OOF")
  266.                             local M2OOF = M2:FindFirstChild("OOF")
  267.                             local M3OOF = M3:FindFirstChild("OOF")
  268.                             local M4OOF = M4:FindFirstChild("OOF")
  269.                             local L3G = script.Parent:FindFirstChild("L3G")
  270.                             local attackcount = 0
  271.                            
  272.                             local info3 = TweenInfo.new(
  273.                                 3,
  274.                                 Enum.EasingStyle.Linear,
  275.                                 Enum.EasingDirection.Out,
  276.                                 0,
  277.                                 false,
  278.                                 1  
  279.                             )
  280.                            
  281.                             local infocomplete3 = TweenInfo.new(
  282.                                 2,
  283.                                 Enum.EasingStyle.Circular,
  284.                                 Enum.EasingDirection.Out,
  285.                                 0,
  286.                                 false,
  287.                                 0  
  288.                             )
  289.                            
  290.                             local goal3a = {Position = Vector3.new(-69, 38.75, -24)}
  291.                             local goal3b = {Position = Vector3.new(-59, 38.75, -34)}
  292.                             local goal3c = {Position = Vector3.new(-69, 38.75, -44)}
  293.                             local goal3d = {Position = Vector3.new(-79, 38.75, -34)}
  294.                             local goalcomplete3 = {Position = Vector3.new(-62.5, 45.25, -34)}
  295.                             local aparttween = TweenService:Create(FB1, info3, goal3a)
  296.                             local bparttween = TweenService:Create(FB2, info3, goal3b)
  297.                             local cparttween = TweenService:Create(FB3, info3, goal3c)
  298.                             local dparttween = TweenService:Create(FB4, info3, goal3d)
  299.                             local completetween3 = TweenService:Create(L3G, infocomplete3, goalcomplete3)
  300.                            
  301.                             --scriptstart
  302.                             ----MoL2.Transparency = 0.35
  303.                             FB1.Fire.Enabled = true
  304.                             FB2.Fire.Enabled = true
  305.                             FB3.Fire.Enabled = true
  306.                             FB4.Fire.Enabled = true
  307.                             wait(1.5)
  308.                             repeat
  309.                                 aparttween:play()
  310.                                 wait(0.25)
  311.                                 bparttween:play()
  312.                                 wait(0.25)
  313.                                 cparttween:play()
  314.                                 wait(0.25)
  315.                                 dparttween:play()
  316.                                 dparttween.Completed:wait()
  317.                                 attackcount = attackcount + 1
  318.                                 script.Parent.Marker1.Transparency = 0
  319.                                 script.Parent.Marker2.Transparency = 0
  320.                                 script.Parent.Marker3.Transparency = 0
  321.                                 script.Parent.Marker4.Transparency = 0
  322.                                 wait(0.25)
  323.                                 FB1.Position = Vector3.new(-69, 73.25, -24)
  324.                                 FB2.Position = Vector3.new(-59, 73.25, -34)
  325.                                 FB3.Position = Vector3.new(-69, 73.25, -44)
  326.                                 FB4.Position = Vector3.new(-79, 73.25, -34)
  327.                                 wait(0.25)
  328.                                 print(attackcount)
  329.                             until attackcount == 4
  330.                             FB1.Fire.Enabled = false
  331.                             FB2.Fire.Enabled = false
  332.                             FB3.Fire.Enabled = false
  333.                             FB4.Fire.Enabled = false
  334.                             --MoL2.Transparency = 1
  335.                             wait(1.5) -- add player check here
  336.                            
  337.                             if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  338.                                 attackcount = 0
  339.                                 Growcount = 0
  340.                                 Rotecount = 0
  341.                                 ResetBossFight()
  342.                                 script.Parent.Door.HingeConstraint.AngularVelocity = 1
  343.                             else
  344.                                 script.Parent.Door.HingeConstraint.AngularVelocity = -1
  345.                                 local ClickDetector = Instance.new("ClickDetector")
  346.                                 ClickDetector.Parent = L3G
  347.                                 ClickDetector.MaxActivationDistance = 32
  348.                                 local CDt = L3G:WaitForChild("ClickDetector")
  349.                                 L3G.Transparency = 0.35
  350.                                 CDt.MouseClick:Connect(function()
  351.                                     CDt:Destroy()
  352.                                     L3G.Anchored = false
  353.                                     completetween3:play()
  354.                                    
  355.                                     --L1R.CanCollide = true
  356.                                 end)
  357.                                 attackcount = 0
  358.                                 Growcount = 0
  359.                                 Rotecount = 0
  360.                                 completetween3.Completed:wait()
  361.                                 L3G.Anchored = true
  362.                                 L3G.Transparency = 0
  363.                                
  364.                                 if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  365.                                     ResetBossFight()
  366.                                     script.Parent.Door.HingeConstraint.AngularVelocity = 1
  367.                                 else
  368.                                     script.Parent.Door.HingeConstraint.AngularVelocity = -1
  369.  
  370.                                     --start L4                                                  --LEVEL 4
  371.                                     wait(3)
  372.                                     local MoL4 = script.Parent:FindFirstChild("Ammo")
  373.                                     local MoL4flame = MoL4.Fire
  374.                                     local L4B = script.Parent:FindFirstChild("L4B")
  375.                                     local throwcount = 0
  376.  
  377.                                     local info4 = TweenInfo.new(
  378.                                         1,
  379.                                         Enum.EasingStyle.Exponential,
  380.                                         Enum.EasingDirection.Out,
  381.                                         0,
  382.                                         true,
  383.                                         0  
  384.                                     )
  385.  
  386.                                     local infocomplete4 = TweenInfo.new(
  387.                                         2,
  388.                                         Enum.EasingStyle.Circular,
  389.                                         Enum.EasingDirection.Out,
  390.                                         0,
  391.                                         false,
  392.                                         0  
  393.                                     )
  394.  
  395.                                     local goal4 = {Position = script.Parent.Parent.MegaSquadMo.ClosestTarget.Value}
  396.                                     local goalcomplete4 = {Position = Vector3.new(-64.232, 47.25, -38.768)}
  397.                                     local ammotween = TweenService:Create(MoL4, info4, goal4)
  398.                                     local completetween4 = TweenService:Create(L4B, infocomplete4, goalcomplete4)
  399.  
  400.                                     --scriptstart
  401.                                     MoL4.Transparency = 0
  402.                                     MoL4flame.Enabled = true
  403.                                     wait(1.5)
  404.                                     repeat
  405.                                         goal4 = {Position = script.Parent.Parent.MegaSquadMo.ClosestTarget.Value}
  406.                                         ammotween = TweenService:Create(MoL4, info4, goal4)
  407.                                         ammotween:play()
  408.                                         ammotween.Completed:wait()
  409.                                         throwcount = throwcount + 1
  410.                                         print(throwcount)
  411.                                         MoL4.Position = Vector3.new(-69, 47, -34)
  412.                                         wait(0.5)
  413.                                     until throwcount == 8
  414.                                     MoL4flame.Enabled = false
  415.                                     MoL4.Transparency = 1
  416.                                     wait(1.5) -- add player check here
  417.  
  418.                                     if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  419.                                         throwcount = 0
  420.                                         attackcount = 0
  421.                                         Growcount = 0
  422.                                         Rotecount = 0
  423.                                         ResetBossFight()
  424.                                         script.Parent.Door.HingeConstraint.AngularVelocity = 1
  425.                                     else
  426.                                         script.Parent.Door.HingeConstraint.AngularVelocity = -1
  427.                                         local ClickDetector = Instance.new("ClickDetector")
  428.                                         ClickDetector.Parent = L4B
  429.                                         ClickDetector.MaxActivationDistance = 32
  430.                                         local CDt = L4B:WaitForChild("ClickDetector")
  431.                                         L4B.Transparency = 0.35
  432.                                         CDt.MouseClick:Connect(function()
  433.                                             CDt:Destroy()
  434.                                             L4B.Anchored = false
  435.                                             completetween4:play()  
  436.  
  437.                                             --L1R.CanCollide = true
  438.                                         end)
  439.                                         throwcount = 0
  440.                                         attackcount = 0
  441.                                         Growcount = 0
  442.                                         Rotecount = 0
  443.                                         completetween4.Completed:wait()
  444.                                         L4B.Anchored = true
  445.                                         L4B.Transparency = 0
  446.  
  447.                                         if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  448.                                             ResetBossFight()
  449.                                             script.Parent.Door.HingeConstraint.AngularVelocity = 1
  450.                                         else
  451.                                             script.Parent.Door.HingeConstraint.AngularVelocity = -1
  452.                                            
  453.                                             --start L5                                                                          --LEVEL 5
  454.                                             wait(3)
  455.                                             local MoL1 = script.Parent:FindFirstChild("MoL1")
  456.                                             local L1OOF = MoL1:FindFirstChild("OOF")
  457.                                             local L1R = script.Parent:FindFirstChild("L1R")
  458.                                             local Rotecount = 0
  459.  
  460.                                             local info1 = TweenInfo.new(
  461.                                                 5,
  462.                                                 Enum.EasingStyle.Linear,
  463.                                                 Enum.EasingDirection.Out,
  464.                                                 0,
  465.                                                 false,
  466.                                                 0  
  467.                                             )
  468.  
  469.                                             local infocomplete1 = TweenInfo.new(
  470.                                                 2,
  471.                                                 Enum.EasingStyle.Circular,
  472.                                                 Enum.EasingDirection.Out,
  473.                                                 0,
  474.                                                 false,
  475.                                                 0  
  476.                                             )
  477.  
  478.                                             local goal1 = {Orientation = Vector3.new(0, 360, 0)}
  479.                                             local goalcomplete1 = {Position = Vector3.new(-69, 41.25, -27.5)}
  480.                                             local rotateparttween = TweenService:Create(MoL1, info1, goal1)
  481.                                             local completetween = TweenService:Create(L1R, infocomplete1, goalcomplete1)
  482.                                            
  483.                                             local MoL2 = script.Parent:FindFirstChild("MoL2")
  484.                                             local L2OOF = MoL2:FindFirstChild("OOF")
  485.                                             local L2Y = script.Parent:FindFirstChild("L2Y")
  486.                                             local Growcount = 0
  487.  
  488.                                             local info2 = TweenInfo.new(
  489.                                                 5,
  490.                                                 Enum.EasingStyle.Quint,
  491.                                                 Enum.EasingDirection.InOut,
  492.                                                 0,
  493.                                                 true,
  494.                                                 0  
  495.                                             )
  496.  
  497.                                             local infocomplete2 = TweenInfo.new(
  498.                                                 2,
  499.                                                 Enum.EasingStyle.Circular,
  500.                                                 Enum.EasingDirection.Out,
  501.                                                 0,
  502.                                                 false,
  503.                                                 0  
  504.                                             )
  505.  
  506.                                             local goal2 = {Size = Vector3.new(35, 0.75, 35)}
  507.                                             local goalcomplete2 = {Position = Vector3.new(-64.232, 43.25, -29.232)}
  508.                                             local growparttween = TweenService:Create(MoL2, info2, goal2)
  509.                                             local completetween2 = TweenService:Create(L2Y, infocomplete2, goalcomplete2)
  510.                                            
  511.                                             local FB1 = script.Parent:FindFirstChild("FireBall1")
  512.                                             local FB2 = script.Parent:FindFirstChild("FireBall2")
  513.                                             local FB3 = script.Parent:FindFirstChild("FireBall3")
  514.                                             local FB4 = script.Parent:FindFirstChild("FireBall4")
  515.                                             local FB1OOF = FB1:FindFirstChild("OOF")
  516.                                             local FB2OOF = FB2:FindFirstChild("OOF")
  517.                                             local FB3OOF = FB3:FindFirstChild("OOF")
  518.                                             local FB4OOF = FB4:FindFirstChild("OOF")
  519.                                             local M1 = script.Parent:FindFirstChild("Marker1")
  520.                                             local M2 = script.Parent:FindFirstChild("Marker2")
  521.                                             local M3 = script.Parent:FindFirstChild("Marker3")
  522.                                             local M4 = script.Parent:FindFirstChild("Marker4")
  523.                                             local M1OOF = M1:FindFirstChild("OOF")
  524.                                             local M2OOF = M2:FindFirstChild("OOF")
  525.                                             local M3OOF = M3:FindFirstChild("OOF")
  526.                                             local M4OOF = M4:FindFirstChild("OOF")
  527.                                             local L3G = script.Parent:FindFirstChild("L3G")
  528.                                             local attackcount = 0
  529.  
  530.                                             local info3 = TweenInfo.new(
  531.                                                 5,
  532.                                                 Enum.EasingStyle.Linear,
  533.                                                 Enum.EasingDirection.Out,
  534.                                                 0,
  535.                                                 false,
  536.                                                 1  
  537.                                             )
  538.  
  539.                                             local infocomplete3 = TweenInfo.new(
  540.                                                 2,
  541.                                                 Enum.EasingStyle.Circular,
  542.                                                 Enum.EasingDirection.Out,
  543.                                                 0,
  544.                                                 false,
  545.                                                 0  
  546.                                             )
  547.  
  548.                                             local goal3a = {Position = Vector3.new(-69, 38.75, -24)}
  549.                                             local goal3b = {Position = Vector3.new(-59, 38.75, -34)}
  550.                                             local goal3c = {Position = Vector3.new(-69, 38.75, -44)}
  551.                                             local goal3d = {Position = Vector3.new(-79, 38.75, -34)}
  552.                                             local goalcomplete3 = {Position = Vector3.new(-62.5, 45.25, -34)}
  553.                                             local aparttween = TweenService:Create(FB1, info3, goal3a)
  554.                                             local bparttween = TweenService:Create(FB2, info3, goal3b)
  555.                                             local cparttween = TweenService:Create(FB3, info3, goal3c)
  556.                                             local dparttween = TweenService:Create(FB4, info3, goal3d)
  557.                                             local completetween3 = TweenService:Create(L3G, infocomplete3, goalcomplete3)
  558.                                            
  559.                                            
  560.                                             local L5P = script.Parent:FindFirstChild("L5P")
  561.                                            
  562.                                             local infocomplete5 = TweenInfo.new(
  563.                                                 2,
  564.                                                 Enum.EasingStyle.Circular,
  565.                                                 Enum.EasingDirection.Out,
  566.                                                 0,
  567.                                                 false,
  568.                                                 0  
  569.                                             )
  570.                                            
  571.                                             local goalcomplete5 = {Position = Vector3.new(-69, 49.25, -40.5)}
  572.                                             local completetween5 = TweenService:Create(L5P, infocomplete5, goalcomplete5)
  573.  
  574.                                             --scriptstart
  575.                                             FB1.Fire.Enabled = true
  576.                                             FB2.Fire.Enabled = true
  577.                                             FB3.Fire.Enabled = true
  578.                                             FB4.Fire.Enabled = true
  579.                                            
  580.                                             MoL2.Transparency = 0.35
  581.                                             L2OOF.Disabled = false
  582.                                            
  583.                                             MoL1.Transparency = 0.35
  584.                                             L1OOF.Disabled = false
  585.                                             wait(1.5)
  586.                                             repeat
  587.                                                 rotateparttween:play()
  588.                                                 growparttween:play()
  589.                                                 aparttween:play()
  590.                                                 bparttween:play()
  591.                                                 cparttween:play()
  592.                                                 dparttween:play()
  593.                                                 rotateparttween.Completed:wait()
  594.                                                 Rotecount = Rotecount + 1
  595.                                                 print(Rotecount)
  596.                                                 script.Parent.Marker1.Transparency = 0
  597.                                                 script.Parent.Marker2.Transparency = 0
  598.                                                 script.Parent.Marker3.Transparency = 0
  599.                                                 script.Parent.Marker4.Transparency = 0
  600.                                                 wait(0.25)
  601.                                                 FB1.Position = Vector3.new(-69, 73.25, -24)
  602.                                                 FB2.Position = Vector3.new(-59, 73.25, -34)
  603.                                                 FB3.Position = Vector3.new(-69, 73.25, -44)
  604.                                                 FB4.Position = Vector3.new(-79, 73.25, -34)
  605.                                             until Rotecount == 4
  606.                                             L1OOF.Disabled = true
  607.                                             MoL1.Transparency = 1
  608.                                             L2OOF.Disabled = true
  609.                                             MoL2.Transparency = 1
  610.                                             FB1.Fire.Enabled = false
  611.                                             FB2.Fire.Enabled = false
  612.                                             FB3.Fire.Enabled = false
  613.                                             FB4.Fire.Enabled = false
  614.                                             wait(1.5) -- add player check here
  615.  
  616.                                             if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  617.                                                 throwcount = 0
  618.                                                 attackcount = 0
  619.                                                 Growcount = 0
  620.                                                 Rotecount = 0
  621.                                                 ResetBossFight()
  622.                                                 script.Parent.Door.HingeConstraint.AngularVelocity = 1
  623.                                             else
  624.                                                 script.Parent.Door.HingeConstraint.AngularVelocity = -1
  625.                                                 local ClickDetector = Instance.new("ClickDetector")
  626.                                                 ClickDetector.Parent = L5P
  627.                                                 ClickDetector.MaxActivationDistance = 32
  628.                                                 local CDt = L5P:WaitForChild("ClickDetector")
  629.                                                 L5P.Transparency = 0.35
  630.                                                 CDt.MouseClick:Connect(function()
  631.                                                     CDt:Destroy()
  632.                                                     L5P.Anchored = false
  633.                                                     completetween5:play()  
  634.  
  635.                                                     --L1R.CanCollide = true
  636.                                                 end)
  637.                                                 throwcount = 0
  638.                                                 attackcount = 0
  639.                                                 Growcount = 0
  640.                                                 Rotecount = 0
  641.                                                 completetween5.Completed:wait()
  642.                                                 L5P.Anchored = true
  643.                                                 L5P.Transparency = 0
  644.  
  645.                                                 if CheckIfPlayerIsInArea(Area) == false then --check to see if player is still in mingame
  646.                                                     ResetBossFight()
  647.                                                     script.Parent.Door.HingeConstraint.AngularVelocity = 1
  648.                                                 else
  649.                                                     script.Parent.Door.HingeConstraint.AngularVelocity = -1
  650.                                                    
  651.                                                     wait(1.5)
  652.                                                     L1R.Material = Enum.Material.Neon
  653.                                                     L1R.CanCollide = true
  654.                                                     L1R.Touched:Connect(function()
  655.                                                         L2Y.Material = Enum.Material.Neon
  656.                                                         L2Y.CanCollide = true
  657.                                                         L2Y.Touched:Connect(function()
  658.                                                             L3G.Material = Enum.Material.Neon
  659.                                                             L3G.CanCollide = true
  660.                                                             L3G.Touched:Connect(function()
  661.                                                                 L4B.Material = Enum.Material.Neon
  662.                                                                 L4B.CanCollide = true
  663.                                                                 L4B.Touched:Connect(function()
  664.                                                                     L5P.Material = Enum.Material.Neon
  665.                                                                     L5P.CanCollide = true
  666.                                                                     L5P.Touched:Connect(function()
  667.                                                                         wait(1.5)
  668.                                                                         script.Parent.protection.backtx.Transparency = 0
  669.                                                                         script.Parent.protection.lefttx.Transparency = 0
  670.                                                                         script.Parent.protection.fronttx.Transparency = 0
  671.                                                                         script.Parent.protection.righttx.Transparency = 0
  672.                                                                         wait(1.5)
  673.                                                                         script.Parent.Parent.MegaSquadMo.Head.face.Texture = "rbxassetid://5941708511"
  674.                                                                         wait(3)
  675.                                                                         script.Parent.exit.Script.Disabled = false
  676.                                                                         wait(3)
  677.                                                                         repeat
  678.                                                                             CheckIfPlayerIsInArea(Area)
  679.                                                                             wait(1)
  680.                                                                         until CheckIfPlayerIsInArea(Area) == false
  681.                                                                         ResetBossFight()
  682.                                                                         script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = true
  683.                                                                         wait(1.5)
  684.                                                                         script.Parent.Parent.MegaSquadMo.Rotationscript.Disabled = false
  685.                                                                         wait(5)
  686.                                                                         script.Parent.Door.HingeConstraint.AngularVelocity = 1
  687.                                                                     end)
  688.                                                                 end)
  689.                                                             end)
  690.                                                         end)
  691.                                                     end)
  692.                                    
  693.                                                     --db = false
  694.                                                 end
  695.                                             end
  696.                                         end
  697.                                     end
  698.                                 end
  699.                             end
  700.                         end
  701.                     end
  702.                 end
  703.             end
  704.         end
  705.     end
  706. end)
  707.  
  708.  
  709.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement