Advertisement
qsenko1

My Obby DragonStage Script

Aug 24th, 2021
1,292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.50 KB | None | 0 0
  1. -- Made by Qsenko
  2. local player = game.Players.LocalPlayer
  3. local part = game.ReplicatedStorage.DragonLevelHitBox:WaitForChild("HellPathHitBox")
  4. local debounce = true
  5. local plrs = {}
  6.  
  7. local HellPath = part:Clone()
  8. HellPath.Parent = game.Workspace
  9. HellPath.Name = "HellPathHitBox"
  10. HellPath.CFrame = CFrame.new(-941.062, 207.249, -623.244) * CFrame.Angles(math.rad(0),math.rad(-6),math.rad(0))
  11.  
  12. local FirstDragonBreathSoundEffect = player.PlayerGui:WaitForChild("LocalSounds").FirstDragonRoar
  13. local DragonBreathSoundEffect = player.PlayerGui:WaitForChild("LocalSounds").DragonBreath
  14. local Dragon = game.ReplicatedStorage.DragonLevelHitBox:WaitForChild("RealisticEnderDragon"):Clone()
  15. Dragon.Parent = game.Workspace
  16. Dragon.Name = "RealisticEnderDragon"
  17. local AnimationController = Dragon:FindFirstChild("AnimationController")
  18. local animator = AnimationController:FindFirstChildOfClass("Animator")
  19. local Animation = AnimationController:FindFirstChild("Animation")
  20. local DragonanimationTrack = animator:LoadAnimation(Animation)
  21.  
  22. local Miner = game.ReplicatedStorage.DragonLevelHitBox:WaitForChild("TheMiner"):Clone()
  23. Miner.Parent = game.Workspace
  24. Miner.Name = "Miner"
  25. local MinerHumanoid = Miner:FindFirstChild("Humanoid")
  26. local MinerSound = Miner.Head:FindFirstChild("Scream")
  27. local MinerAnimator = MinerHumanoid:FindFirstChild("Animator")
  28. local MinerAnimation = Miner:FindFirstChild("Animation")
  29. local MinerAnimTrack = MinerAnimator:LoadAnimation(MinerAnimation)
  30.  
  31. HellPath.Touched:Connect(function(onTouched)
  32.     if player then 
  33.         if onTouched.Parent:FindFirstChild("Humanoid") and debounce then   
  34.             debounce = false
  35.            
  36.             local players = game.Players:GetChildren()
  37.             for i = 1,#players do
  38.                 if players[i].Name ~= player.Name then
  39.                    table.insert(plrs,workspace[players[i].Name])
  40.                 end
  41.             end
  42.             for i = 1,#plrs do
  43.                 plrs[i].Parent = nil
  44.             end
  45.            
  46.             onTouched.Parent:FindFirstChild("Humanoid").WalkSpeed = 0
  47.             onTouched.Parent:FindFirstChild("Humanoid").JumpHeight = 0
  48.             DragonanimationTrack:Play()
  49.             MinerAnimTrack:Play()
  50.             wait(5)
  51.             onTouched.Parent:FindFirstChild("Humanoid").WalkSpeed = 16
  52.             onTouched.Parent:FindFirstChild("Humanoid").JumpHeight = 7.2
  53.             wait(21.04)
  54.             for i = 1,#plrs do
  55.                 plrs[i].Parent = workspace
  56.             end
  57.             plrs = {}      
  58.             debounce = true
  59.         end
  60.     end
  61. end)
  62.  
  63. local function MinerVisible()  
  64.     Miner.Head.Transparency = 0
  65.     Miner["Left Arm"].Transparency = 0
  66.     Miner["Left Leg"].Transparency = 0
  67.     Miner.Pickaxe.Transparency = 0
  68.     Miner["Right Arm"].Transparency = 0
  69.     Miner["Right Leg"].Transparency = 0
  70.     Miner.Torso.Transparency = 0
  71.     Miner.Head.Hat.Transparency = 0
  72. end
  73.  
  74. local function MinerTransparent()
  75.     Miner.Head.Transparency = 1
  76.     Miner["Left Arm"].Transparency = 1
  77.     Miner["Left Leg"].Transparency = 1
  78.     Miner.Pickaxe.Transparency = 1
  79.     Miner["Right Arm"].Transparency = 1
  80.     Miner["Right Leg"].Transparency = 1
  81.     Miner.Torso.Transparency = 1
  82.     Miner.Head.Hat.Transparency = 1
  83. end
  84.  
  85. MinerAnimTrack:GetMarkerReachedSignal("MinerVisible"):Connect(function()
  86.     Miner.Head.RunBilboard.SurfaceGui.Enabled = true
  87.     Miner.Head["Scared face"].Transparency = 0
  88.     MinerVisible()
  89. end)
  90.  
  91. MinerAnimTrack:GetMarkerReachedSignal("MinerSoundPlay"):Connect(function()
  92.     Miner.Head.Scream:Play()
  93. end)
  94.  
  95. MinerAnimTrack:GetMarkerReachedSignal("GetTransparent"):Connect(function()
  96.     Miner.Head.RunBilboard.SurfaceGui.Enabled = false
  97.     Miner.Head["Scared face"].Transparency = 1
  98.     MinerTransparent()
  99. end)
  100.  
  101. local function DragonVisible()
  102.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do          
  103.         if not v:IsA("Motor6D") and v.Name ~= "DragonBreathHitbox" and v.Name ~= "GroundLandEffect" and v.Name ~= "FireParticles" and v.Name ~= "FireParticles2" then
  104.         if v:IsA("Part") or v:IsA("UnionOperation") then
  105.             v.Transparency = 0 
  106.            end 
  107.         end    
  108.     end
  109. end
  110.  
  111. local function DragonInvisible()
  112.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  113.         if v:IsA("Part") or v:IsA("UnionOperation") then
  114.             v.Transparency = 1
  115.         end
  116.     end
  117. end
  118.  
  119. DragonanimationTrack:GetMarkerReachedSignal("BecomeVisible"):Connect(function()
  120.     DragonVisible()
  121. end)
  122.  
  123. DragonanimationTrack:GetMarkerReachedSignal("GroundSlashLandEffect"):Connect(function()
  124.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants())do
  125.         if v:IsA("BasePart") and v.Name == "GroundLandEffect" then
  126.             v.Effect.Enabled = true
  127.             wait(1)
  128.             v.Effect.Enabled = false
  129.         end
  130.     end
  131. end)
  132.  
  133. DragonanimationTrack:GetMarkerReachedSignal("FirstFireBreath"):Connect(function()
  134.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  135.         if v:IsA("Part") and v.Name == "FireParticles" then
  136.             v.Fire.Enabled = true
  137.             FirstDragonBreathSoundEffect:Play()
  138.         end
  139.     end
  140. end)
  141.  
  142. DragonanimationTrack:GetMarkerReachedSignal("FirstFireBreathStop"):Connect(function()
  143.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  144.         if v:IsA("Part") and v.Name == "FireParticles" then
  145.             v.Fire.Enabled = false
  146.             v.Fire2.Enabled = false
  147.         end
  148.     end
  149. end)
  150.  
  151. DragonanimationTrack:GetMarkerReachedSignal("Second FireBreath"):Connect(function()
  152.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  153.         if v:IsA("Part") and v.Name == "FireParticles" then
  154.             v.MainFire.Enabled = true
  155.             DragonBreathSoundEffect:Play()
  156.             wait(1)    
  157.             v.Parent.FireParticles2.Fire.Enabled = true
  158.         end
  159.     end
  160. end)
  161.  
  162. DragonanimationTrack:GetMarkerReachedSignal("Second FireBreathStop"):Connect(function()
  163.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  164.         if v:IsA("Part") and v.Name == "FireParticles" then
  165.             v.MainFire.Enabled = false
  166.             v.Fire2.Enabled = true
  167.             v.Parent.FireParticles2.Fire.Enabled = false
  168.         end
  169.     end
  170. end)
  171.  
  172. DragonanimationTrack:GetMarkerReachedSignal("FirstFireBreathStop"):Connect(function()
  173.     for i,v in pairs(Dragon.HumanoidRootPart:GetDescendants()) do
  174.         if v:IsA("Part") and v.Name == "FireParticles" then
  175.             v.Fire2.Enabled = false
  176.         end
  177.     end
  178. end)
  179.  
  180. DragonanimationTrack:GetMarkerReachedSignal("BecomeInvisible"):Connect(function()
  181.     DragonInvisible()
  182. end)
  183.  
  184. local DragonHitBox = Dragon
  185. local debounce2 = true
  186.  
  187. for i,v in pairs(DragonHitBox:GetDescendants()) do
  188. --  print(v)
  189.     if v:IsA("Part") and v.Name == "DragonBreathHitbox" then
  190. --  print(v)
  191.     local DragonHitBox2 = v
  192. --  print(DragonHitBox2)
  193. DragonHitBox2.Touched:Connect(function(hit)
  194.     if player then
  195.         if hit.Parent:FindFirstChild("Humanoid") and debounce2 then
  196.             debounce2 = false
  197.         --  print("hi")
  198.             hit.Parent.Humanoid.Health = nil       
  199.             wait(.1)   
  200.             debounce2 = true       
  201.             end
  202.          end
  203.       end)
  204.    end
  205. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement