FurkingBoi

Treasure Quest

Dec 23rd, 2019
5,906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. wait(3)
  2. if game.Workspace:FindFirstChild("DungeonFolder") == nil then
  3. game.ReplicatedStorage:WaitForChild("Remotes")
  4. game.Players.LocalPlayer:WaitForChild("leaderstats")
  5. function start()
  6. print("Starting")
  7. local Event = game:GetService("ReplicatedStorage").Remotes.Squads.Start
  8. Event:FireServer()
  9. end
  10. function join(area,dif)
  11. local Event = game:GetService("ReplicatedStorage").Remotes.RequestPrizeClaim
  12. Event:InvokeServer()
  13. local A_1 = area
  14. local A_2 = dif
  15. local A_3 = "Solo"
  16. local Event = game:GetService("ReplicatedStorage").Remotes.Squads.Create
  17. Event:FireServer(A_1, A_2, A_3)
  18. print("made lobby in "..area..' on difficulty '.. dif..'.')
  19. wait(1)
  20. start()
  21. end
  22. local l = game.Players.LocalPlayer:WaitForChild("leaderstats").Level.Value
  23. if l < 5 then
  24. join('Ancient Jungle','Easy')
  25. elseif l >= 5 and l < 10 then
  26. join('Ancient Jungle','Medium')
  27. elseif l >= 10 and l <15 then
  28. join('Coral Kingdom','Easy')
  29. elseif l >= 15 and l < 20 then
  30. join('Coral Kingdom','Medium')
  31. elseif l >= 20 and l < 25 then
  32. join('Crystal Cave','Easy')
  33. elseif l >= 25 and l < 30 then
  34. join('Crystal Cave','Medium')
  35. elseif l >= 30 and l < 35 then
  36. join('Sacred Sands','Easy')
  37. elseif l >= 35 and l < 40 then
  38. join('Sacred Sands','Medium')
  39. elseif l >= 40 and l < 45 then
  40. join('Candy Land','Easy')
  41. elseif l >= 45 and l < 50 then
  42. join('Candy Land','Medium')
  43. elseif l >= 50 and l < 55 then
  44. join('Candy Land','Hard')
  45. elseif l >= 50 and l < 55 then
  46. join('Candy Land','Demon')
  47. elseif l >= 60 then
  48. join('Candy Land','Impossible')
  49. end
  50. else
  51.  
  52. game:GetService("ReplicatedStorage").Remotes.Dungeon.Begin:FireServer()
  53.  
  54.  
  55. function attack()
  56. while wait(.5) do
  57. for _,v in pairs(game.Workspace.DungeonFolder:GetChildren()) do
  58. if v:FindFirstChild("Monsters") ~= nil then
  59. for _,v in pairs(v.Monsters:GetChildren()) do
  60. if v:FindFirstChild("Head") ~= nil then
  61. local TweenService = game:GetService("TweenService")
  62.  
  63. local tweenInfo = TweenInfo.new(
  64. 1, -- Time
  65. Enum.EasingStyle.Linear, -- EasingStyle
  66. Enum.EasingDirection.Out, -- EasingDirection
  67. 1, -- RepeatCount (when less than zero the tween will loop indefinitely)
  68. false, -- Reverses (tween will reverse once reaching it's goal)
  69. 0 -- DelayTime
  70. )
  71.  
  72. local tween = TweenService:Create(game.Players.LocalPlayer.Character.HumanoidRootPart, tweenInfo, {CFrame = v.Head.CFrame + Vector3.new(0,15,0)})
  73.  
  74. tween:Play()
  75. local pos = v.Head.Position
  76.  
  77. repeat
  78. wait()
  79. game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
  80. game:GetService("ReplicatedStorage").Remotes.Attack:FireServer()
  81. game:GetService("ReplicatedStorage").Remotes.HitMonster:FireServer(game:GetService("Workspace").PlayerWeapons[game.Players.LocalPlayer.Name],v.Head)
  82.  
  83. until v.Humanoid.Health == 0
  84. end
  85. end
  86. end
  87. end
  88. end
  89. end
  90. function at()
  91. while wait(.5) do
  92. for _,v in pairs(game.Workspace.DungeonFolder:GetChildren()) do
  93. if v:FindFirstChild("Monsters") ~= nil then
  94. for _,v in pairs(v.Monsters:GetChildren()) do
  95. if v:FindFirstChild("Head") ~= nil then
  96. game:GetService("ReplicatedStorage").Remotes.Attack:FireServer()
  97. game:GetService("ReplicatedStorage").Remotes.HitMonster:FireServer(game:GetService("Workspace").PlayerWeapons[game.Players.LocalPlayer.Name],v.Head)
  98.  
  99. end
  100. end
  101. end
  102. end
  103. end
  104. end
  105. function bil()
  106. while wait(.5) do
  107. game:GetService("ReplicatedStorage").Remotes.Ability:FireServer()
  108. end
  109. end
  110. function heal()
  111. while wait(.5) do
  112. for _,v in pairs(game.Workspace:GetDescendants()) do
  113. if v.Name == 'TouchInterest' and v.Parent.ClassName == 'MeshPart' or v.Name == 'TouchInterest' and v.Parent.ClassName =='Part' then
  114. v.Parent.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  115. end
  116. end
  117. end
  118. end
  119. spawn(bil)
  120. spawn(attack)
  121. spawn(at)
  122. spawn(heal)
  123. game.Players.LocalPlayer.Character.HumanoidRootPart.Orientation = Vector3.new(-80,78,0)
  124. game.Workspace.DungeonFolder:WaitForChild("EndRoom"):WaitForChild("Finish").CFrame = game.Players.LocalPlayer.Character.Head.CFrame
  125.  
  126. end
Add Comment
Please, Sign In to add comment