Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version = "v0.1"
- function MainScript()
- local Fluent = loadstring(game:HttpGet("https://raw.githubusercontent.com/xpa1n/library/main/FluentLibrary.lua"))()
- local Window = Fluent:CreateWindow({
- Title = "Blade Slayer 剧本",
- SubTitle = version,
- TabWidth = 160,
- Size = UDim2.fromOffset(580, 460),
- Acrylic = true, -- The blur may be detectable, setting this to false disables blur entirely
- Theme = "Dark",
- MinimizeKey = Enum.KeyCode.LeftControl -- Used when theres no MinimizeKeybind
- })
- local Tabs = {
- main = Window:AddTab({ Title = "主要", Icon = "swords" }),
- }
- do
- local mainmain = Tabs.main:AddSection("自動農作")
- local mobNames = {}
- local SelectMobsDropdown
- local function RefreshMobDropdown()
- local uniqueMobs = {}
- for _, enemy in pairs(game.Workspace.Enemys:GetChildren()) do
- uniqueMobs[enemy.Name] = true
- end
- table.clear(mobNames)
- for mobName in pairs(uniqueMobs) do
- table.insert(mobNames, mobName)
- end
- if SelectMobsDropdown then
- SelectMobsDropdown:SetValues(mobNames)
- end
- end
- mainmain:AddButton({
- Title = "刷新怪物",
- Callback = function()
- RefreshMobDropdown()
- end
- })
- SelectMobsDropdown = mainmain:AddDropdown("SelectMobsDropdown", {
- Title = "選擇怪物",
- Description = "您可以選擇多個值",
- Values = mobNames,
- Multi = true,
- Default = {},
- })
- -- Initial population of the dropdown
- RefreshMobDropdown()
- local Values = {}
- SelectMobsDropdown:OnChanged(function(Value)
- table.clear(Values)
- for i, v in pairs(Value) do
- table.insert(Values, i)
- end
- end)
- local Players = game:GetService("Players")
- local Workspace = game:GetService("Workspace")
- local player = Players.LocalPlayer
- local char = player.Character or player.CharacterAdded:Wait()
- local hrp = char:WaitForChild("HumanoidRootPart")
- local targetMobs = {}
- function findTargetMobs()
- local newTargets = {}
- for _, v in pairs(Values) do
- for _, enemy in pairs(Workspace.Enemys:GetChildren()) do
- if enemy:IsA("Model") and
- enemy:FindFirstChild("HumanoidRootPart") and
- enemy:FindFirstChild("Humanoid") and
- enemy.Humanoid.Health > 0 and
- v == enemy.Name then
- table.insert(newTargets, enemy)
- end
- end
- end
- return newTargets
- end
- function Autofarm()
- local function updateTargets()
- targetMobs = findTargetMobs()
- end
- local function teleportTargets()
- for _, target in ipairs(targetMobs) do
- if target and target:FindFirstChild("HumanoidRootPart") then
- target.HumanoidRootPart.CFrame = hrp.CFrame * CFrame.new(0, 0, -7)
- end
- end
- end
- updateTargets()
- teleportTargets()
- end
- local FarmToggle = mainmain:AddToggle("FarmToggle", {Title = "開始農作", Default = false})
- FarmToggle:OnChanged(function()
- _G.AutoFarm = FarmToggle.Value
- targetMobs = {} -- Reset the target mobs when the toggle changes
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoFarm and not _G.AutoHatchNearest then
- Autofarm()
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoFarm then
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local X, Y = 0, 0
- VirtualInputManager:SendMouseButtonEvent(X, Y, 0, true, game, 1)
- VirtualInputManager:SendMouseButtonEvent(X, Y, 0, false, game, 1)
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoFarm then
- hrp.Anchored = true
- end
- if not _G.AutoFarm then
- hrp.Anchored = false
- end
- end
- end))
- local other = Tabs.main:AddSection("其他")
- local AutoEquipBestWeapon = other:AddToggle("AutoEquipBestWeapon", {Title = "自動裝備最佳武器", Default = false})
- AutoEquipBestWeapon:OnChanged(function()
- _G.AutoEquip = AutoEquipBestWeapon.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait(2) do
- if _G.AutoEquip then
- game:GetService("ReplicatedStorage").Remotes.EquipBestWeapon:FireServer()
- end
- end
- end))
- local AutoFuze = other:AddToggle("AutoFuze", {Title = "自動合成武器", Default = false})
- AutoFuze:OnChanged(function()
- _G.AutoFuze = AutoFuze.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait(2) do
- if _G.AutoFuze then
- game:GetService("ReplicatedStorage").Remotes.FuseWeapon:FireServer()
- end
- end
- end))
- local AutoRebirth = other:AddToggle("AutoRebirth", {Title = "自動重生", Default = false})
- AutoRebirth:OnChanged(function()
- _G.AutoRebirth = AutoRebirth.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait(2) do
- if _G.AutoRebirth then
- game:GetService("ReplicatedStorage").Remotes.PlayerReborn:FireServer()
- end
- end
- end))
- local other = Tabs.main:AddSection("英雄")
- local AutoHatchNearest = other:AddToggle("AutoHatchNearest", {Title = "自動孵化英雄(最近的)", Default = false})
- AutoHatchNearest:OnChanged(function()
- _G.AutoHatchNearest = AutoHatchNearest.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoHatchNearest then
- local mapsFolder = game.Workspace.Maps
- local currentmap = mapsFolder:GetChildren()[1]
- if currentmap then
- local currentmap2 = currentmap:FindFirstChild("Map")
- if currentmap2 then
- local currentmapeggs = currentmap2:FindFirstChild("Eggs")
- if currentmapeggs then
- local Egg = currentmapeggs:GetChildren()[1]
- hrp.CFrame = Egg.CFrame
- task.wait()
- local button = game:service'VirtualInputManager'
- button:SendKeyEvent(true, "E", false, game)
- task.wait()
- button:SendKeyEvent(false, "E", false, game)
- end
- end
- end
- end
- end
- end))
- local AutoEquipBestHero = other:AddToggle("AutoEquipBestHero", {Title = "自動裝備最佳英雄", Default = false})
- AutoEquipBestHero:OnChanged(function()
- _G.AutoEquipBestHero = AutoEquipBestHero.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait(2) do
- if _G.AutoEquipBestHero then
- game:GetService("ReplicatedStorage").Remotes.AutoEquipBestHero:FireServer()
- end
- end
- end))
- -- -- -- -- -- -- --
- end
- Window:SelectTab(1)
- end
- MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement