Advertisement
xpa1nx0

Slime Slaying Online RPG Script

Aug 11th, 2024 (edited)
1,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 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 = "Slime Slaying Online RPG 剧本",
  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 function getUpdatedEnemyList()
  25. local enemyList = {}
  26. local seenEnemies = {}
  27.  
  28. for i, v in pairs(game:GetService("Workspace").Enemies:GetChildren()) do
  29. local enemyName = v.Name
  30. if not seenEnemies[enemyName] then
  31. seenEnemies[enemyName] = true
  32. table.insert(enemyList, enemyName)
  33. end
  34. end
  35.  
  36. return enemyList
  37. end
  38.  
  39. -- Create the multi-dropdown
  40. local MultiDropdown = mainmain:AddDropdown("MultiDropdown", {
  41. Title = "选择敌人",
  42. Description = "你可以选择多个值。",
  43. Values = getUpdatedEnemyList(),
  44. Multi = true,
  45. Default = {""},
  46. })
  47.  
  48. Values = {}
  49.  
  50. MultiDropdown:OnChanged(function(Value)
  51. table.clear(Values)
  52.  
  53. for Value, State in next, Value do
  54. table.insert(Values, Value)
  55. end
  56. end)
  57.  
  58. _G.switch = false
  59.  
  60. local Toggle = mainmain:AddToggle("MyToggle", {Title = "开始自动化农场", Default = _G.switch })
  61.  
  62. Toggle:OnChanged(function(value)
  63. _G.switch = value
  64. end)
  65.  
  66. coroutine.resume(coroutine.create(function()
  67. while task.wait() do
  68. pcall(function()
  69. if _G.switch then
  70. for i,v in pairs(Values) do
  71. for x, y in pairs(game:GetService("Workspace").Enemies:GetChildren()) do
  72. if v == y.Name and y:IsA("Model") and y.Humanoid.Health > 0 then
  73. local player = game.Players.LocalPlayer
  74. local camera = game.Workspace.CurrentCamera
  75. local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
  76.  
  77. if y.HumanoidRootPart then
  78. humanoidRootPart.CFrame = y.HumanoidRootPart.CFrame * CFrame.new(0, 0, 5)
  79. camera.CFrame = CFrame.new(humanoidRootPart.Position, y.HumanoidRootPart.Position)
  80. end
  81. end
  82. end
  83. end
  84. end
  85. end)
  86. end
  87. end))
  88.  
  89. mainmain:AddButton({
  90. Title = " 刷新怪物",
  91. Description = "",
  92. Callback = function()
  93. local updatedEnemyList = getUpdatedEnemyList()
  94. MultiDropdown:SetValues(updatedEnemyList)
  95. end
  96. })
  97.  
  98. -- -- -- -- -- -- --
  99. end
  100. Window:SelectTab(1)
  101. end
  102.  
  103. MainScript()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement