Advertisement
pastebinxx

Untitled

Oct 16th, 2024
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.18 KB | None | 0 0
  1. if not game:IsLoaded() then
  2. game.Loaded:Wait()
  3. end
  4. SettingsAutofarm = {}
  5. if _G.AutofarmSettings then
  6. SettingsAutofarm = _G.AutofarmSettings
  7. else
  8. _G.AutofarmSettings = {}
  9. SettingsAutofarm = {AntiAfk = true, DelayFarm = 3}
  10. end
  11. _G.AutoFarmMM2IsLoaded = true
  12. Player = game.Players.LocalPlayer
  13. Players = game.Players
  14. CoreGui = game.CoreGui
  15. GuiLibrary = loadstring(game:HttpGet("https://raw.githubusercontent.com/elfandtears/GuiLibrary/main/source.lua"))()
  16. RunService = game:GetService("RunService")
  17. CoinCollectedEvent = game.ReplicatedStorage.Remotes.Gameplay.CoinCollected
  18. RoundStartEvent = game.ReplicatedStorage.Remotes.Gameplay.RoundStart
  19. RoundEndEvent = game.ReplicatedStorage.Remotes.Gameplay.RoundEndFade
  20. RandomNameFunction = GuiLibrary.RandomName
  21. MainGui = GuiLibrary.ScreenGUI({
  22. Name = RandomNameFunction(),
  23. ResetOnSpawn = false,
  24. Parent = CoreGui
  25. })
  26. MainFrame = GuiLibrary.Frame({
  27. Name = RandomNameFunction(),
  28. AnchorPoint = Vector2.new(.5, .5),
  29. BackgroundColor3 = Color3.new(0.784314, 0.784314, 0.784314),
  30. Position = UDim2.new(.5, 0, .5, 0),
  31. Size = UDim2.new(0.131, 0, 0.413, 0),
  32. ZIndex = 2,
  33. Parent = MainGui,
  34. Draggable_ = true
  35. })
  36. MainFrameBorder = GuiLibrary.Frame({
  37. Name = RandomNameFunction(),
  38. AnchorPoint = Vector2.new(.5, .5),
  39. BackgroundColor3 = Color3.new(0, 0, 0),
  40. Position = UDim2.new(.5, 0, .5, 0),
  41. Size = UDim2.new(0.138, 0, 0.434, 0),
  42. ZIndex = 1,
  43. Parent = MainGui,
  44. attach = MainFrame
  45. })
  46. MainFrameUiCorner = GuiLibrary.UICorner({
  47. Name = RandomNameFunction(),
  48. CornerRadius = UDim.new(0, 12),
  49. Parent = MainFrame
  50. })
  51. MainFrameBorderUiCorner = GuiLibrary.UICorner({
  52. Name = RandomNameFunction(),
  53. CornerRadius = UDim.new(0, 12),
  54. Parent = MainFrameBorder
  55. })
  56. CloseMainFrameButton = GuiLibrary.TextButton({
  57. Name = RandomNameFunction(),
  58. BackgroundTransparency = 1,
  59. Position = UDim2.new(0.8, 0, 0, 0),
  60. Size = UDim2.new(0.2, 0, 0.125, 0),
  61. ["Font"] = Enum.Font.FredokaOne,
  62. Text = "X",
  63. ZIndex = 2,
  64. TextColor3 = Color3.new(1, 0, 0),
  65. TextScaled = true,
  66. Parent = MainFrame
  67. })
  68. NameTextLabel = GuiLibrary.TextLabel({
  69. Name = RandomNameFunction(),
  70. BackgroundTransparency = 1,
  71. Position = UDim2.new(0, 0, 0, 0),
  72. Size = UDim2.new(0.8, 0, 0.125, 0),
  73. ["Font"] = Enum.Font.FredokaOne,
  74. Text = "Autofarm",
  75. ZIndex = 2,
  76. TextColor3 = Color3.new(0, 0, 0),
  77. TextScaled = true,
  78. Parent = MainFrame
  79. })
  80. AntiAfkButton = GuiLibrary.TextButton({
  81. Name = RandomNameFunction(),
  82. BackgroundColor3 = Color3.new(0, 0.666667, 1),
  83. BorderColor3 = Color3.new(0, 0, 0),
  84. BorderSizePixel = 2,
  85. Position = UDim2.new(0.1, 0, 0.125, 0),
  86. Size = UDim2.new(0.8, 0, 0.125, 0),
  87. ["Font"] = Enum.Font.FredokaOne,
  88. Text = "Anti afk",
  89. ZIndex = 2,
  90. TextColor3 = Color3.new(1, 1, 1),
  91. TextScaled = true,
  92. Parent = MainFrame
  93. })
  94. StartAutofarmButton = GuiLibrary.TextButton({
  95. Name = RandomNameFunction(),
  96. BackgroundColor3 = Color3.new(0, 0.666667, 1),
  97. BorderColor3 = Color3.new(0, 0, 0),
  98. BorderSizePixel = 2,
  99. Position = UDim2.new(0.1, 0, 0.282, 0),
  100. Size = UDim2.new(0.8, 0, 0.125, 0),
  101. ["Font"] = Enum.Font.FredokaOne,
  102. Text = "Start",
  103. ZIndex = 2,
  104. TextColor3 = Color3.new(1, 1, 1),
  105. TextScaled = true,
  106. Parent = MainFrame
  107. })
  108. Disable3DRenderingButton = GuiLibrary.TextButton({
  109. Name = RandomNameFunction(),
  110. BackgroundColor3 = Color3.new(0, 0.666667, 1),
  111. BorderColor3 = Color3.new(0, 0, 0),
  112. BorderSizePixel = 2,
  113. Position = UDim2.new(0.1, 0, 0.438, 0),
  114. Size = UDim2.new(0.8, 0, 0.125, 0),
  115. ["Font"] = Enum.Font.FredokaOne,
  116. Text = "Disable 3D rendering",
  117. TextColor3 = Color3.new(1, 1, 1),
  118. TextScaled = true,
  119. ZIndex = 2,
  120. Parent = MainFrame
  121. })
  122. ImproveFPSButton = GuiLibrary.TextButton({
  123. Name = RandomNameFunction(),
  124. BackgroundColor3 = Color3.new(0, 0.666667, 1),
  125. BorderColor3 = Color3.new(0, 0, 0),
  126. BorderSizePixel = 2,
  127. Position = UDim2.new(0.1, 0, 0.595, 0),
  128. Size = UDim2.new(0.8, 0, 0.125, 0),
  129. ["Font"] = Enum.Font.FredokaOne,
  130. Text = "Improve FPS",
  131. ZIndex = 2,
  132. TextColor3 = Color3.new(1, 1, 1),
  133. TextScaled = true,
  134. Parent = MainFrame
  135. })
  136. CoinTypeButton = GuiLibrary.TextButton({
  137. Name = RandomNameFunction(),
  138. BackgroundColor3 = Color3.new(0, 0.666667, 1),
  139. BorderColor3 = Color3.new(0, 0, 0),
  140. BorderSizePixel = 2,
  141. Position = UDim2.new(0.1, 0, 0.757, 0),
  142. Size = UDim2.new(0.8, 0, 0.125, 0),
  143. ["Font"] = Enum.Font.FredokaOne,
  144. Text = "Farm coin type: BeachBalls",
  145. ZIndex = 2,
  146. TextColor3 = Color3.new(1, 1, 1),
  147. TextScaled = true,
  148. Parent = MainFrame
  149. })
  150. OpenAutofarmGui = GuiLibrary.TextButton({
  151. Name = RandomNameFunction(),
  152. AnchorPoint = Vector2.new(.5, .5),
  153. BackgroundColor3 = Color3.new(1, 0.333333, 0.498039),
  154. BorderColor3 = Color3.new(0, 0, 0),
  155. BorderSizePixel = 2,
  156. BorderMode = Enum.BorderMode.Inset,
  157. Position = UDim2.new(0.5, 0, 0.028, 0),
  158. Size = UDim2.new(0.104, 0, 0.052, 0),
  159. ["Font"] = Enum.Font.FredokaOne,
  160. Text = "Open autofarm gui",
  161. ZIndex = 4,
  162. TextColor3 = Color3.new(1, 1, 1),
  163. TextScaled = true,
  164. Visible = false,
  165. Parent = MainGui
  166. })
  167.  
  168. --from infinity yield lol
  169. AntiAfkState = false
  170. function AntiAFK()
  171. local GC = getconnections or get_signal_cons
  172. if GC then
  173. for i,v in pairs(GC(Player.Idled)) do
  174. if v["Disable"] then
  175. v["Disable"](v)
  176. elseif v["Disconnect"] then
  177. v["Disconnect"](v)
  178. end
  179. end
  180. else
  181. local VirtualUser = cloneref(game:GetService("VirtualUser"))
  182. Players.LocalPlayer.Idled:Connect(function()
  183. VirtualUser:CaptureController()
  184. VirtualUser:ClickButton2(Vector2.new())
  185. end)
  186. end
  187. end
  188.  
  189. --yeah yeah this button do nothing, you cant turn off anti afk
  190. function AntiAFKButton()
  191. if not AntiAfkState then
  192. AntiAfkState = true
  193. AntiAfkButton.TextColor3 = Color3.new(0, 1, 0)
  194. AntiAFK()
  195. else
  196. AntiAfkState = false
  197. AntiAfkButton.TextColor3 = Color3.new(1, 1, 1)
  198. end
  199. end
  200.  
  201. AutofarmStarted = false
  202. function StartAutofarmButtonC()
  203. if not AutofarmStarted then
  204. AutofarmStarted = true
  205. AutofarmIN = true
  206. StartAutofarmButton.TextColor3 = Color3.new(0, 1, 0)
  207. else
  208. AutofarmStarted = false
  209. StartAutofarmButton.TextColor3 = Color3.new(1, 1, 1)
  210. end
  211. end
  212.  
  213. --Disable your 3D rendering for improve your fps
  214. D3RenderingDisabled = false
  215. function Disabl3dRender()
  216. if not D3RenderingDisabled then
  217. D3RenderingDisabled = true
  218. RunService:Set3dRenderingEnabled(false)
  219. Disable3DRenderingButton.TextColor3 = Color3.new(0, 1, 0)
  220. else
  221. D3RenderingDisabled = false
  222. RunService:Set3dRenderingEnabled(true)
  223. Disable3DRenderingButton.TextColor3 = Color3.new(1, 1, 1)
  224. end
  225. end
  226.  
  227. ImproveFPSenabled = false
  228. function ImproveFPSButtonC()
  229. if not ImproveFPSenabled then
  230. ImproveFPSenabled = true
  231. for _, player in pairs(Players:GetChildren()) do
  232. if player.Character then
  233. for _, part in pairs(player.Character:GetChildren()) do
  234. if part:IsA("Accessory") then
  235. part:Destroy()
  236. end
  237. if part.Name == "Radio" then
  238. part:Destroy()
  239. end
  240. end
  241. end
  242. end
  243. ImproveFPSButton.TextColor3 = Color3.new(0, 1, 0)
  244. else
  245. ImproveFPSenabled = false
  246. ImproveFPSButton.TextColor3 = Color3.new(1, 1, 1)
  247. end
  248. end
  249.  
  250. CoinTypes = {"Candy"}
  251. CurrentCoinType = "Candy"
  252. PositionOfCoinType = 1
  253. function ChangeCandyType(cointype)
  254. if cointype then
  255. if table.find(CoinTypes, cointype) then
  256. CurrentCoinType = cointype
  257. PositionOfCoinType = table.find(CoinTypes, cointype)
  258. CoinTypeButton.Text = "Farm coin type: "..cointype
  259. return
  260. end
  261. return
  262. end
  263. if PositionOfCoinType ~= table.maxn(CoinTypes) then
  264. PositionOfCoinType += 1
  265. CoinTypeButton.Text = "Farm coin type: "..CoinTypes[PositionOfCoinType]
  266. CurrentCoinType = CoinTypes[PositionOfCoinType]
  267. else
  268. PositionOfCoinType = 1
  269. CoinTypeButton.Text = "Farm coin type: "..CoinTypes[PositionOfCoinType]
  270. CurrentCoinType = CoinTypes[PositionOfCoinType]
  271. end
  272. end
  273.  
  274. function CloseGuiCheck()
  275. if MainFrame.Visible == true then
  276. OpenAutofarmGui.Visible = true
  277. MainFrame.Visible = false
  278. MainFrameBorder.Visible = false
  279. else
  280. MainFrame.Visible = true
  281. MainFrameBorder.Visible = true
  282. OpenAutofarmGui.Visible = false
  283. end
  284. end
  285.  
  286. AutofarmDelay = 3
  287. ResetWhenFullBag = false
  288. AutofarmIN = false
  289. bringpose = CFrame.new(math.random(-5, 5), -100, math.random(-5, 5)) --nvm
  290. safepart = Instance.new("Part")
  291. safepart.Anchored = true
  292. safepart.Massless = true
  293. safepart.Transparency = 1
  294. safepart.Size = Vector3.new(2048, 0.5, 2048)
  295. safepart.CFrame = bringpose * CFrame.new(0, -0.9, 0)
  296. safepart.Parent = workspace
  297.  
  298. function returncoincontaier()
  299. if workspace:FindFirstChild("Normal") then
  300. if workspace.Normal:FindFirstChild("CoinContainer") then
  301. return workspace.Normal:FindFirstChild("CoinContainer")
  302. end
  303. end
  304. return false
  305. end
  306.  
  307. CoinCollectedEvent.OnClientEvent:Connect(function(cointype, current, max)
  308. AutofarmIN = true
  309. if cointype == CurrentCoinType and tonumber(current) == tonumber(max) then
  310. AutofarmIN = false
  311. if ResetWhenFullBag then
  312. Player.Character.Humanoid.Health = 0
  313. end
  314. end
  315. end)
  316.  
  317. function PcallTP(Position)
  318. if Player.Character then
  319. if Player.Character:FindFirstChild("HumanoidRootPart") then
  320. Player.Character.HumanoidRootPart.CFrame = Position
  321. end
  322. end
  323. end
  324.  
  325. local function checkModules()
  326. for _, child in pairs(workspace:GetChildren()) do
  327. if child:IsA("Model") and child.Name ~= "Lobby" then
  328. local spawnsFolder = child:FindFirstChild("Spawns")
  329. if spawnsFolder then
  330. return child.Parent
  331. end
  332. end
  333. end
  334. return false
  335. end
  336.  
  337. local function FindMap()
  338. for _, v in pairs(workspace:GetChildren()) do
  339. if v:FindFirstChild("CoinContainer") then
  340. return v.CoinContainer
  341. end
  342. end
  343. return nil
  344. end
  345.  
  346. spawn(function()
  347. while true do
  348. local realMap = checkModules()
  349.  
  350. if AutofarmStarted and AutofarmIN and Player.Character and realMap and FindMap() then
  351. for _, v in pairs(FindMap():GetChildren()) do
  352. if v:GetAttribute("CoinID") == "Candy" then
  353. for i = 1,2 do
  354. PcallTP(v.CFrame)
  355. task.wait(0.3)
  356. end
  357. break
  358. end
  359. end
  360. PcallTP(bringpose)
  361. end
  362. task.wait(AutofarmDelay)
  363. end
  364. end)
  365.  
  366. RoundStartEvent.OnClientEvent:Connect(function()
  367. if AutofarmStarted then Player.Character.HumanoidRootPart.CFrame = bringpose end
  368. AutofarmIN = true
  369. end)
  370.  
  371. RoundEndEvent.OnClientEvent:Connect(function()
  372. AutofarmIN = false
  373. end)
  374.  
  375. --Improve fps connections:
  376. for _, player1 in pairs(Players:GetChildren()) do
  377. player1.CharacterAdded:Connect(function(char)
  378. task.wait(0.5) --just because
  379. if ImproveFPSenabled then
  380. for _, part in pairs(char:GetChildren()) do
  381. if part:IsA("Accessory") then
  382. part:Destroy()
  383. end
  384. if part.Name == "Radio" then
  385. part:Destroy()
  386. end
  387. end
  388. end
  389. end)
  390. end
  391.  
  392. Players.PlayerAdded:Connect(function(player1)
  393. player1.CharacterAdded:Connect(function(char)
  394. task.wait(0.5) --just because
  395. if ImproveFPSenabled then
  396. for _, part in pairs(char:GetChildren()) do
  397. if part:IsA("Accessory") then
  398. part:Destroy()
  399. end
  400. if part.Name == "Radio" then
  401. part:Destroy()
  402. end
  403. end
  404. end
  405. end)
  406. end)
  407.  
  408. --Buttons connections
  409. AntiAfkButton.MouseButton1Click:Connect(AntiAFKButton)
  410. ImproveFPSButton.MouseButton1Click:Connect(ImproveFPSButtonC)
  411. StartAutofarmButton.MouseButton1Click:Connect(StartAutofarmButtonC)
  412. Disable3DRenderingButton.MouseButton1Click:Connect(Disabl3dRender)
  413. CoinTypeButton.MouseButton1Click:Connect(ChangeBeachballType)
  414. CloseMainFrameButton.MouseButton1Click:Connect(CloseGuiCheck)
  415. OpenAutofarmGui.MouseButton1Click:Connect(CloseGuiCheck)
  416.  
  417. --Configs
  418. for Configname, Configvalue in pairs(SettingsAutofarm) do
  419. if Configname == "AntiAfk" and Configvalue == true then
  420. AntiAFKButton()
  421. elseif Configname == "DelayFarm" and tonumber(Configvalue) and tonumber(Configvalue) < 8 then
  422. AutofarmDelay = tonumber(Configvalue)
  423. elseif Configname == "StartAutofarm" and Configvalue == true then
  424. StartAutofarmButtonC()
  425. elseif Configname == "ImproveFPS" and Configvalue == true then
  426. ImproveFPSButtonC()
  427. elseif Configname == "Disable3DRendering" and Configvalue == true then
  428. Disabl3dRender()
  429. elseif Configname == "CoinType" and Configvalue then
  430. ChangeBeachballType(Configvalue)
  431. elseif Configname == "ResetWhenFullBag" and Configvalue == true then
  432. ResetWhenFullBag = true
  433. end
  434. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement