Advertisement
xpa1nx0

blade slayer cc2

Oct 6th, 2024 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.51 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 = "Blade Slayer 剧本",
  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. main = Window:AddTab({ Title = "主要", Icon = "swords" }),
  18. }
  19.  
  20. do
  21.  
  22. local mainmain = Tabs.main:AddSection("自動農作")
  23.  
  24. local mobNames = {}
  25. local SelectMobsDropdown
  26.  
  27. local function RefreshMobDropdown()
  28. local uniqueMobs = {}
  29. for _, enemy in pairs(game.Workspace.Enemys:GetChildren()) do
  30. uniqueMobs[enemy.Name] = true
  31. end
  32.  
  33. table.clear(mobNames)
  34. for mobName in pairs(uniqueMobs) do
  35. table.insert(mobNames, mobName)
  36. end
  37.  
  38. if SelectMobsDropdown then
  39. SelectMobsDropdown:SetValues(mobNames)
  40. end
  41. end
  42.  
  43. mainmain:AddButton({
  44. Title = "刷新怪物",
  45. Callback = function()
  46. RefreshMobDropdown()
  47. end
  48. })
  49.  
  50. SelectMobsDropdown = mainmain:AddDropdown("SelectMobsDropdown", {
  51. Title = "選擇怪物",
  52. Description = "您可以選擇多個值",
  53. Values = mobNames,
  54. Multi = true,
  55. Default = {},
  56. })
  57.  
  58. -- Initial population of the dropdown
  59. RefreshMobDropdown()
  60.  
  61. local Values = {}
  62.  
  63. SelectMobsDropdown:OnChanged(function(Value)
  64. table.clear(Values)
  65. for i, v in pairs(Value) do
  66. table.insert(Values, i)
  67. end
  68. end)
  69.  
  70. local Players = game:GetService("Players")
  71. local Workspace = game:GetService("Workspace")
  72. local player = Players.LocalPlayer
  73. local char = player.Character or player.CharacterAdded:Wait()
  74. local hrp = char:WaitForChild("HumanoidRootPart")
  75. local targetMobs = {}
  76.  
  77. function findTargetMobs()
  78. local newTargets = {}
  79. for _, v in pairs(Values) do
  80. for _, enemy in pairs(Workspace.Enemys:GetChildren()) do
  81. if enemy:IsA("Model") and
  82. enemy:FindFirstChild("HumanoidRootPart") and
  83. enemy:FindFirstChild("Humanoid") and
  84. enemy.Humanoid.Health > 0 and
  85. v == enemy.Name then
  86. table.insert(newTargets, enemy)
  87. end
  88. end
  89. end
  90. return newTargets
  91. end
  92.  
  93. function Autofarm()
  94. local function updateTargets()
  95. targetMobs = findTargetMobs()
  96. end
  97.  
  98. local function teleportTargets()
  99. for _, target in ipairs(targetMobs) do
  100. if target and target:FindFirstChild("HumanoidRootPart") then
  101. target.HumanoidRootPart.CFrame = hrp.CFrame * CFrame.new(0, 0, -7)
  102. end
  103. end
  104. end
  105.  
  106. updateTargets()
  107. teleportTargets()
  108. end
  109.  
  110. local FarmToggle = mainmain:AddToggle("FarmToggle", {Title = "開始農作", Default = false})
  111. FarmToggle:OnChanged(function()
  112. _G.AutoFarm = FarmToggle.Value
  113. targetMobs = {} -- Reset the target mobs when the toggle changes
  114. end)
  115.  
  116. coroutine.resume(coroutine.create(function()
  117. while task.wait() do
  118. if _G.AutoFarm and not _G.AutoHatchNearest then
  119. Autofarm()
  120. end
  121. end
  122. end))
  123.  
  124.  
  125. coroutine.resume(coroutine.create(function()
  126. while task.wait() do
  127. if _G.AutoFarm then
  128. local VirtualInputManager = game:GetService("VirtualInputManager")
  129. local X, Y = 0, 0
  130. VirtualInputManager:SendMouseButtonEvent(X, Y, 0, true, game, 1)
  131. VirtualInputManager:SendMouseButtonEvent(X, Y, 0, false, game, 1)
  132. end
  133. end
  134. end))
  135.  
  136. coroutine.resume(coroutine.create(function()
  137. while task.wait() do
  138. if _G.AutoFarm then
  139. hrp.Anchored = true
  140. end
  141. if not _G.AutoFarm then
  142. hrp.Anchored = false
  143. end
  144. end
  145. end))
  146.  
  147. local other = Tabs.main:AddSection("其他")
  148.  
  149. local AutoEquipBestWeapon = other:AddToggle("AutoEquipBestWeapon", {Title = "自動裝備最佳武器", Default = false})
  150. AutoEquipBestWeapon:OnChanged(function()
  151. _G.AutoEquip = AutoEquipBestWeapon.Value
  152. end)
  153.  
  154. coroutine.resume(coroutine.create(function()
  155. while task.wait(2) do
  156. if _G.AutoEquip then
  157. game:GetService("ReplicatedStorage").Remotes.EquipBestWeapon:FireServer()
  158. end
  159. end
  160. end))
  161.  
  162. local AutoFuze = other:AddToggle("AutoFuze", {Title = "自動合成武器", Default = false})
  163. AutoFuze:OnChanged(function()
  164. _G.AutoFuze = AutoFuze.Value
  165. end)
  166.  
  167. coroutine.resume(coroutine.create(function()
  168. while task.wait(2) do
  169. if _G.AutoFuze then
  170. game:GetService("ReplicatedStorage").Remotes.FuseWeapon:FireServer()
  171. end
  172. end
  173. end))
  174.  
  175. local AutoRebirth = other:AddToggle("AutoRebirth", {Title = "自動重生", Default = false})
  176. AutoRebirth:OnChanged(function()
  177. _G.AutoRebirth = AutoRebirth.Value
  178. end)
  179.  
  180. coroutine.resume(coroutine.create(function()
  181. while task.wait(2) do
  182. if _G.AutoRebirth then
  183. game:GetService("ReplicatedStorage").Remotes.PlayerReborn:FireServer()
  184. end
  185. end
  186. end))
  187.  
  188. local other = Tabs.main:AddSection("英雄")
  189.  
  190. local AutoHatchNearest = other:AddToggle("AutoHatchNearest", {Title = "自動孵化英雄(最近的)", Default = false})
  191. AutoHatchNearest:OnChanged(function()
  192. _G.AutoHatchNearest = AutoHatchNearest.Value
  193. end)
  194.  
  195. coroutine.resume(coroutine.create(function()
  196. while task.wait() do
  197. if _G.AutoHatchNearest then
  198.  
  199. local mapsFolder = game.Workspace.Maps
  200. local currentmap = mapsFolder:GetChildren()[1]
  201.  
  202. if currentmap then
  203. local currentmap2 = currentmap:FindFirstChild("Map")
  204. if currentmap2 then
  205. local currentmapeggs = currentmap2:FindFirstChild("Eggs")
  206. if currentmapeggs then
  207. local Egg = currentmapeggs:GetChildren()[1]
  208. hrp.CFrame = Egg.CFrame
  209. task.wait()
  210. local button = game:service'VirtualInputManager'
  211. button:SendKeyEvent(true, "E", false, game)
  212. task.wait()
  213. button:SendKeyEvent(false, "E", false, game)
  214. end
  215. end
  216. end
  217.  
  218. end
  219. end
  220. end))
  221.  
  222.  
  223. local AutoEquipBestHero = other:AddToggle("AutoEquipBestHero", {Title = "自動裝備最佳英雄", Default = false})
  224. AutoEquipBestHero:OnChanged(function()
  225. _G.AutoEquipBestHero = AutoEquipBestHero.Value
  226. end)
  227.  
  228. coroutine.resume(coroutine.create(function()
  229. while task.wait(2) do
  230. if _G.AutoEquipBestHero then
  231. game:GetService("ReplicatedStorage").Remotes.AutoEquipBestHero:FireServer()
  232. end
  233. end
  234. end))
  235.  
  236. -- -- -- -- -- -- --
  237. end
  238. Window:SelectTab(1)
  239. end
  240.  
  241. MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement