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 = "Slime Slaying Online RPG 剧本",
- 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 function getUpdatedEnemyList()
- local enemyList = {}
- local seenEnemies = {}
- for i, v in pairs(game:GetService("Workspace").Enemies:GetChildren()) do
- local enemyName = v.Name
- if not seenEnemies[enemyName] then
- seenEnemies[enemyName] = true
- table.insert(enemyList, enemyName)
- end
- end
- return enemyList
- end
- -- Create the multi-dropdown
- local MultiDropdown = mainmain:AddDropdown("MultiDropdown", {
- Title = "选择敌人",
- Description = "你可以选择多个值。",
- Values = getUpdatedEnemyList(),
- Multi = true,
- Default = {""},
- })
- Values = {}
- MultiDropdown:OnChanged(function(Value)
- table.clear(Values)
- for Value, State in next, Value do
- table.insert(Values, Value)
- end
- end)
- _G.switch = false
- local Toggle = mainmain:AddToggle("MyToggle", {Title = "开始自动化农场", Default = _G.switch })
- Toggle:OnChanged(function(value)
- _G.switch = value
- end)
- coroutine.resume(coroutine.create(function()
- while task.wait() do
- pcall(function()
- if _G.switch then
- for i,v in pairs(Values) do
- for x, y in pairs(game:GetService("Workspace").Enemies:GetChildren()) do
- if v == y.Name and y:IsA("Model") and y.Humanoid.Health > 0 then
- local player = game.Players.LocalPlayer
- local camera = game.Workspace.CurrentCamera
- local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
- if y.HumanoidRootPart then
- humanoidRootPart.CFrame = y.HumanoidRootPart.CFrame * CFrame.new(0, 0, 5)
- camera.CFrame = CFrame.new(humanoidRootPart.Position, y.HumanoidRootPart.Position)
- end
- end
- end
- end
- end
- end)
- end
- end))
- mainmain:AddButton({
- Title = " 刷新怪物",
- Description = "",
- Callback = function()
- local updatedEnemyList = getUpdatedEnemyList()
- MultiDropdown:SetValues(updatedEnemyList)
- end
- })
- -- -- -- -- -- -- --
- end
- Window:SelectTab(1)
- end
- MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement