Advertisement
xpa1nx0

fabled legacy CC

Mar 23rd, 2024 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1. local version = "v0.1"
  2.  
  3. function MainScript()
  4. local Fluent = loadstring(game:HttpGet("https://raw.githubusercontent.com/xpa1n/library/main/FluentLibrary.lua"))()
  5.  
  6. local Window = Fluent:CreateWindow({
  7. Title = "《Fabled Legacy》剧本",
  8. SubTitle = version,
  9. TabWidth = 160,
  10. Size = UDim2.fromOffset(580, 460),
  11. Acrylic = true, -- The blur may be detectable, setting this to false disables blur entirely
  12. Theme = "Dark",
  13. MinimizeKey = Enum.KeyCode.LeftControl -- Used when theres no MinimizeKeybind
  14. })
  15.  
  16. local Tabs = {
  17. autofarm = Window:AddTab({ Title = "自动农场", Icon = "swords" }),
  18. }
  19.  
  20. do
  21. local Players = game:GetService("Players")
  22. local UserInputService = game:GetService("UserInputService")
  23. local Workspace = game:GetService("Workspace")
  24. local LocalPlayer = Players.LocalPlayer
  25.  
  26. local autofarmsettings = Tabs.autofarm:AddSection("自动农场设置")
  27.  
  28. function teleportPlayerBehind(enemy)
  29. local enemyRootPart = enemy:FindFirstChild("HumanoidRootPart")
  30. local playerCharacter = LocalPlayer.Character
  31.  
  32. if enemyRootPart and playerCharacter then
  33. local playerRootPart = playerCharacter:FindFirstChild("HumanoidRootPart")
  34. if playerRootPart then
  35. local newPosition = enemyRootPart.Position - (enemyRootPart.CFrame.LookVector * 5)
  36. playerRootPart.CFrame = CFrame.new(newPosition)
  37.  
  38. -- Adjusting camera angle to look at the enemy
  39. local camera = game.Workspace.CurrentCamera
  40. camera.CFrame = CFrame.new(newPosition, enemyRootPart.Position)
  41. end
  42. end
  43. end
  44.  
  45. function getClosestEnemy()
  46. local success, closestEnemy = pcall(function()
  47. local closestEnemy = nil
  48. local closestDistance = math.huge
  49.  
  50. for _, descendant in pairs(workspace.Enemies:GetChildren()) do
  51. if descendant:IsA("Model") and descendant:FindFirstChild("HumanoidRootPart") then
  52. local enemyPart = descendant:FindFirstChild("HumanoidRootPart")
  53. local distance = (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - enemyPart.Position).magnitude
  54.  
  55. if distance < closestDistance then
  56. closestEnemy = descendant
  57. closestDistance = distance
  58. end
  59. end
  60. end
  61.  
  62. return closestEnemy
  63. end)
  64.  
  65. if success then
  66. return closestEnemy
  67. else
  68. return nil
  69. end
  70. end
  71.  
  72. local TpMobsToggle = autofarmsettings:AddToggle("TpMobs", {Title = "传送到怪物", Default = false })
  73. _G.TpMobs = false
  74.  
  75. TpMobsToggle:OnChanged(function()
  76. _G.TpMobs = TpMobsToggle.Value
  77. end)
  78.  
  79. coroutine.resume(coroutine.create(function()
  80. while task.wait() do
  81. if _G.TpMobs then
  82. local closestEnemy = getClosestEnemy()
  83. if closestEnemy then
  84. teleportPlayerBehind(closestEnemy)
  85. end
  86. end
  87. end
  88. end))
  89.  
  90. local attacksettings = Tabs.autofarm:AddSection("攻击设置")
  91.  
  92. local AutoAttackToggle = attacksettings:AddToggle("AutoAttack", {Title = "自动攻击", Default = false })
  93. _G.AutoAttack = false
  94.  
  95. AutoAttackToggle:OnChanged(function()
  96. _G.AutoAttack = AutoAttackToggle.Value
  97. end)
  98.  
  99. coroutine.resume(coroutine.create(function()
  100. while task.wait() do
  101. if _G.AutoAttack then
  102. game:GetService("ReplicatedStorage").Swing:FireServer()
  103. end
  104. end
  105. end))
  106.  
  107. local AutoSkillQToggle = attacksettings:AddToggle("AutoSkillQ", {Title = "自动使用技能Q", Default = false })
  108. _G.AutoSkillQ = false
  109.  
  110. AutoSkillQToggle:OnChanged(function()
  111. _G.AutoSkillQ = AutoSkillQToggle.Value
  112. end)
  113.  
  114. coroutine.resume(coroutine.create(function()
  115. while task.wait() do
  116. if _G.AutoSkillQ then
  117. local button = game:service'VirtualInputManager'
  118. button:SendKeyEvent(true, "Q", false, game)
  119. button:SendKeyEvent(false, "Q", false, game)
  120. wait(2)
  121. end
  122. end
  123. end))
  124.  
  125. local AutoSkillEToggle = attacksettings:AddToggle("AutoSkillE", {Title = "自动使用技能E", Default = false })
  126. _G.AutoSkillE = false
  127.  
  128. AutoSkillEToggle:OnChanged(function()
  129. _G.AutoSkillE = AutoSkillEToggle.Value
  130. end)
  131.  
  132. coroutine.resume(coroutine.create(function()
  133. while task.wait() do
  134. if _G.AutoSkillE then
  135. local button = game:service'VirtualInputManager'
  136. button:SendKeyEvent(true, "E", false, game)
  137. button:SendKeyEvent(false, "E", false, game)
  138. wait(2)
  139. end
  140. end
  141. end))
  142.  
  143. local otherx = Tabs.autofarm:AddSection("其他")
  144.  
  145. local ggwalkspeed = 24
  146.  
  147. local WalkSpeed = otherx:AddSlider("WalkSpeed", {
  148. Title = "走路速度",
  149. Default = ggwalkspeed,
  150. Min = 10,
  151. Max = 200,
  152. Rounding = 0,
  153. Callback = function(Value)
  154. ggwalkspeed = Value
  155. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ggwalkspeed
  156. end
  157. })
  158.  
  159. coroutine.resume(coroutine.create(function()
  160. while task.wait() do
  161. if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed ~= ggwalkspeed then
  162. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ggwalkspeed
  163. end
  164. end
  165. end))
  166.  
  167. end
  168. Window:SelectTab(1)
  169. end
  170.  
  171. MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement