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 = "《Fabled Legacy》剧本",
- 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 = {
- autofarm = Window:AddTab({ Title = "自动农场", Icon = "swords" }),
- }
- do
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local Workspace = game:GetService("Workspace")
- local LocalPlayer = Players.LocalPlayer
- local autofarmsettings = Tabs.autofarm:AddSection("自动农场设置")
- function teleportPlayerBehind(enemy)
- local enemyRootPart = enemy:FindFirstChild("HumanoidRootPart")
- local playerCharacter = LocalPlayer.Character
- if enemyRootPart and playerCharacter then
- local playerRootPart = playerCharacter:FindFirstChild("HumanoidRootPart")
- if playerRootPart then
- local newPosition = enemyRootPart.Position - (enemyRootPart.CFrame.LookVector * 5)
- playerRootPart.CFrame = CFrame.new(newPosition)
- -- Adjusting camera angle to look at the enemy
- local camera = game.Workspace.CurrentCamera
- camera.CFrame = CFrame.new(newPosition, enemyRootPart.Position)
- end
- end
- end
- function getClosestEnemy()
- local success, closestEnemy = pcall(function()
- local closestEnemy = nil
- local closestDistance = math.huge
- for _, descendant in pairs(workspace.Enemies:GetChildren()) do
- if descendant:IsA("Model") and descendant:FindFirstChild("HumanoidRootPart") then
- local enemyPart = descendant:FindFirstChild("HumanoidRootPart")
- local distance = (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - enemyPart.Position).magnitude
- if distance < closestDistance then
- closestEnemy = descendant
- closestDistance = distance
- end
- end
- end
- return closestEnemy
- end)
- if success then
- return closestEnemy
- else
- return nil
- end
- end
- local TpMobsToggle = autofarmsettings:AddToggle("TpMobs", {Title = "传送到怪物", Default = false })
- _G.TpMobs = false
- TpMobsToggle:OnChanged(function()
- _G.TpMobs = TpMobsToggle.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.TpMobs then
- local closestEnemy = getClosestEnemy()
- if closestEnemy then
- teleportPlayerBehind(closestEnemy)
- end
- end
- end
- end))
- local attacksettings = Tabs.autofarm:AddSection("攻击设置")
- local AutoAttackToggle = attacksettings:AddToggle("AutoAttack", {Title = "自动攻击", Default = false })
- _G.AutoAttack = false
- AutoAttackToggle:OnChanged(function()
- _G.AutoAttack = AutoAttackToggle.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoAttack then
- game:GetService("ReplicatedStorage").Swing:FireServer()
- end
- end
- end))
- local AutoSkillQToggle = attacksettings:AddToggle("AutoSkillQ", {Title = "自动使用技能Q", Default = false })
- _G.AutoSkillQ = false
- AutoSkillQToggle:OnChanged(function()
- _G.AutoSkillQ = AutoSkillQToggle.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoSkillQ then
- local button = game:service'VirtualInputManager'
- button:SendKeyEvent(true, "Q", false, game)
- button:SendKeyEvent(false, "Q", false, game)
- wait(2)
- end
- end
- end))
- local AutoSkillEToggle = attacksettings:AddToggle("AutoSkillE", {Title = "自动使用技能E", Default = false })
- _G.AutoSkillE = false
- AutoSkillEToggle:OnChanged(function()
- _G.AutoSkillE = AutoSkillEToggle.Value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if _G.AutoSkillE then
- local button = game:service'VirtualInputManager'
- button:SendKeyEvent(true, "E", false, game)
- button:SendKeyEvent(false, "E", false, game)
- wait(2)
- end
- end
- end))
- local otherx = Tabs.autofarm:AddSection("其他")
- local ggwalkspeed = 24
- local WalkSpeed = otherx:AddSlider("WalkSpeed", {
- Title = "走路速度",
- Default = ggwalkspeed,
- Min = 10,
- Max = 200,
- Rounding = 0,
- Callback = function(Value)
- ggwalkspeed = Value
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ggwalkspeed
- end
- })
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed ~= ggwalkspeed then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ggwalkspeed
- end
- end
- end))
- end
- Window:SelectTab(1)
- end
- MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement