Advertisement
flappywierdo49

Spongebob Simulator Autofarm GUI

Jul 15th, 2024 (edited)
817
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.40 KB | Gaming | 0 0
  1. -- the people who made this game suck SO BAD AT CODING that the eggs are broken bad enough to where just looking at their code makes me nauseous LMAO
  2. -- i might add more eggs soon but for now im gonna find other stuff to make, this games code is legit sickening, it was basic math that messes them up
  3. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  4. local Window = Library.CreateLib("Spongebob Simulator Script by d3cryptt", "Serpent") -- for different colors, use these: "GrapeTheme" "DarkTheme" "LightTheme" "BloodTheme" "Ocean" "Midnight" "Sentinel" "Synapse" "Serpent"
  5. -- Autofarm
  6. local Autofarm = Window:NewTab("Autofarm")
  7. local AutofarmSection = Autofarm:NewSection("DONT USE SQUIDWARD TELEPORTS WITH A MORPH!!!")
  8.  
  9.  
  10. -- Define variables for clicking and teleporting states
  11. local clicking = false
  12. local teleporting = false
  13.  
  14. -- Path to the Nodes container
  15. local nodesContainer = game.Workspace:WaitForChild("Nodes")
  16. local radius = 200
  17.  
  18. -- Function to find the closest node within the specified radius
  19. local function getClosestNode()
  20.     local character = game.Players.LocalPlayer.Character
  21.     if not character or not character:FindFirstChild("HumanoidRootPart") then return nil end
  22.  
  23.     local closestNode = nil
  24.     local shortestDistance = radius -- Initialize to the search radius
  25.  
  26.     for _, node in ipairs(nodesContainer:GetChildren()) do
  27.         if node:IsA("Part") then
  28.             local distance = (node.Position - character.HumanoidRootPart.Position).Magnitude
  29.             if distance <= shortestDistance then
  30.                 shortestDistance = distance
  31.                 closestNode = node
  32.             end
  33.         end
  34.     end
  35.  
  36.     return closestNode
  37. end
  38.  
  39. -- Function to click a node
  40. local function clickNode(node)
  41.     local args = {
  42.         [1] = node,
  43.         [2] = true,
  44.         [3] = false
  45.     }
  46.  
  47.     game:GetService("ReplicatedStorage"):WaitForChild("Knit"):WaitForChild("Services"):WaitForChild("NodeService"):WaitForChild("RE"):WaitForChild("NodeClicked"):FireServer(unpack(args))
  48. end
  49.  
  50. -- Function to start the clicking loop
  51. local function startClicking()
  52.     clicking = true
  53.     while clicking do
  54.         local closestNode = getClosestNode()
  55.  
  56.         if closestNode then
  57.             clickNode(closestNode)
  58.             -- Wait until the node is destroyed
  59.             repeat
  60.                 wait(0.1)
  61.             until not closestNode.Parent or not clicking
  62.             wait(0.1) -- Optional: Wait a short delay before targeting the next node
  63.         else
  64.             wait(0.5) -- Check again after a short delay if no node found within radius
  65.         end
  66.     end
  67. end
  68.  
  69. -- Function to stop the clicking loop
  70. local function stopClicking()
  71.     clicking = false
  72. end
  73.  
  74.  
  75.  
  76. -- Add buttons to start and stop the clicking loop
  77. AutofarmSection:NewButton("Start Autofarm", "Start clicking closest node", function()
  78.     startClicking()
  79. end)
  80.  
  81. AutofarmSection:NewButton("Stop Autofarm", "Stop clicking closest node", function()
  82.     stopClicking()
  83. end)
  84.  
  85. AutofarmSection:NewSlider("Autofarm Range", "Adjust the Autofarm range ", 1000, 10, function(value)
  86.     radius = value
  87. end)    
  88.  
  89.  
  90. local AutoPickupTab = Window:NewTab("Auto Pickup")
  91. local AutoPickupSection = AutoPickupTab:NewSection("DONT USE MORPHS!!!")
  92.  
  93. local TweenService = game:GetService("TweenService")
  94. local autoPicking = false
  95. local tweenSpeed = 100 -- Default tween speed
  96. local tweenRadius = 200 -- Default radius for detecting coins
  97.  
  98. -- Path to the Terrain container
  99. local terrainContainer = game.Workspace:WaitForChild("Terrain")
  100.  
  101. -- Function to find the closest attachment with the "Currency_" prefix
  102. local function getClosestAttachment()
  103.     local character = game.Players.LocalPlayer.Character
  104.     if not character or not character:FindFirstChild("HumanoidRootPart") then return nil end
  105.    
  106.     local closestAttachment = nil
  107.     local shortestDistance = tweenRadius -- Initialize to the search radius
  108.    
  109.     for _, item in ipairs(terrainContainer:GetChildren()) do
  110.         if item:IsA("Attachment") and item.Name:match("Currency_") then
  111.             local distance = (item.WorldPosition - character.HumanoidRootPart.Position).Magnitude
  112.             if distance <= shortestDistance then
  113.                 shortestDistance = distance
  114.                 closestAttachment = item
  115.             end
  116.         end
  117.     end
  118.    
  119.     return closestAttachment
  120. end
  121.  
  122. -- Function to tween to a specific position
  123. local function tweenToPosition(targetPosition)
  124.     local character = game.Players.LocalPlayer.Character
  125.     if not character or not character:FindFirstChild("HumanoidRootPart") then return end
  126.  
  127.     local humanoidRootPart = character.HumanoidRootPart
  128.     local tweenInfo = TweenInfo.new(
  129.         (targetPosition - humanoidRootPart.Position).Magnitude / tweenSpeed, -- Adjust the speed dynamically
  130.         Enum.EasingStyle.Linear,
  131.         Enum.EasingDirection.Out
  132.     )
  133.    
  134.     local tween = TweenService:Create(humanoidRootPart, tweenInfo, {CFrame = CFrame.new(targetPosition)})
  135.     tween:Play()
  136.     tween.Completed:Wait()
  137. end
  138.  
  139. -- Function to start the auto picking loop
  140. local function startAutoPicking()
  141.     autoPicking = true
  142.     while autoPicking do
  143.         local closestAttachment = getClosestAttachment()
  144.  
  145.         if closestAttachment then
  146.             tweenToPosition(closestAttachment.WorldPosition)
  147.             wait(0.1) -- Adjust the delay if necessary
  148.         end
  149.         wait(0.1) -- Adjust this delay if necessary
  150.     end
  151. end
  152.  
  153. -- Function to stop the auto picking loop
  154. local function stopAutoPicking()
  155.     autoPicking = false
  156. end
  157.  
  158. -- Create UI elements for the AutoPickup section
  159. AutoPickupSection:NewSlider("Tween Speed", "Adjust the tween speed", 200, 1, function(value)
  160.     tweenSpeed = value
  161. end)
  162.  
  163. AutoPickupSection:NewSlider("Tween Radius", "Adjust the tween radius", 500, 50, function(value)
  164.     tweenRadius = value
  165. end)
  166.  
  167. AutoPickupSection:NewButton("Start AutoPickup", "Start auto picking up closest currency", function()
  168.     startAutoPicking()
  169. end)
  170.  
  171. AutoPickupSection:NewButton("Stop AutoPickup", "Stop auto picking up closest currency", function()
  172.     stopAutoPicking()
  173. end)
  174.  
  175. local AutoEggsSection = Window:NewTab("Auto Eggs")
  176. local AutoEggsSection = AutoEggsSection:NewSection("someone broke the eggs, ADDING MORE SOON DWDW")
  177.  
  178.  
  179. -- Create dropdown options for eggs
  180. local eggOptions = {}
  181. for i = 1, 13 do
  182.     table.insert(eggOptions, "area" .. i .. " basic")
  183.     table.insert(eggOptions, "area" .. i .. " golden")
  184. end
  185.  
  186. local selectedEgg
  187. local autoOpenEggs = false
  188.  
  189. -- Function to open eggs
  190. local function openEgg(egg)
  191.     local args = {
  192.         [1] = egg,
  193.         [2] = 1
  194.     }
  195.     game:GetService("ReplicatedStorage"):WaitForChild("Knit"):WaitForChild("Services"):WaitForChild("ClamService"):WaitForChild("RF"):WaitForChild("Purchase"):InvokeServer(unpack(args))
  196. end
  197.  
  198. -- Function to start auto opening eggs
  199. local function startAutoOpen()
  200.     while autoOpenEggs do
  201.         openEgg(selectedEgg)
  202.         wait(0.1)
  203.     end
  204. end
  205.  
  206. -- Dropdown for selecting egg
  207. AutoEggsSection:NewDropdown("Select Egg", "Select the egg to open", eggOptions, function(currentOption)
  208.     selectedEgg = currentOption
  209.     print("Selected Egg: " .. selectedEgg)
  210. end)
  211.  
  212. -- Button to start auto opening eggs
  213. AutoEggsSection:NewButton("Start Auto Open", "Start automatically opening the selected egg", function()
  214.     if selectedEgg then
  215.         autoOpenEggs = true
  216.         startAutoOpen()
  217.     else
  218.         print("Please select an egg first.")
  219.     end
  220. end)
  221.  
  222. -- Button to stop auto opening eggs
  223. AutoEggsSection:NewButton("Stop Auto Open", "Stop automatically opening eggs", function()
  224.     autoOpenEggs = false
  225.     end)
  226.  
  227.  
  228. local Player = Window:NewTab("Player")
  229. local PlayerSection = Player:NewSection("freakybob is behind you")
  230.  
  231. -- WalkSpeed and JumpPower sliders
  232. PlayerSection:NewSlider("WalkSpeed", "Adjust the WalkSpeed", 200, 16, function(value)
  233.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = value
  234. end)
  235.  
  236. PlayerSection:NewSlider("JumpPower", "Adjust the JumpPower", 200, 50, function(value)
  237.     game.Players.LocalPlayer.Character.Humanoid.JumpPower = value
  238. end)
  239.  
  240. PlayerSection:NewButton("Infinite Yield (Admin Commands)", "gives you admin commands", function()
  241.     loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))()
  242. end)
  243.  
  244. local Quests = Window:NewTab("Quests")
  245. local QuestsSection = Quests:NewSection("just teleports to things like instruments for quests")
  246.  
  247. -- Define the path to check for Secret folders
  248. local secretsPath = game.Workspace.Programmables.Secrets
  249.  
  250. -- List of Secret folders to check
  251. local secretFolders = {"Secret1", "Secret2", "Secret3", "Secret4"}
  252.  
  253. -- Function to teleport to a specific position
  254. local function teleportToPosition(targetPosition)
  255.     local character = game.Players.LocalPlayer.Character
  256.     if not character or not character:FindFirstChild("HumanoidRootPart") then return end
  257.  
  258.     -- Set the character's HumanoidRootPart CFrame to the target position
  259.     character.HumanoidRootPart.CFrame = CFrame.new(targetPosition)
  260. end
  261.  
  262. -- Function to find parts with TouchInterest in Secret folders
  263. local function getSecretParts()
  264.     local parts = {}
  265.     for _, folderName in ipairs(secretFolders) do
  266.         local folder = secretsPath:FindFirstChild(folderName)
  267.         if folder then
  268.             for _, part in ipairs(folder:GetDescendants()) do
  269.                 if part:IsA("Part") and part:FindFirstChild("TouchInterest") then
  270.                     table.insert(parts, part)
  271.                 end
  272.             end
  273.         end
  274.     end
  275.     return parts
  276. end
  277.  
  278. -- Function to start the teleportation loop
  279. local function startTeleporting()
  280.     teleporting = true
  281.     while teleporting do
  282.         local secretParts = getSecretParts()
  283.         for _, part in ipairs(secretParts) do
  284.             if not teleporting then break end
  285.             -- Teleport 3 studs above the part
  286.             local targetPosition = part.Position + Vector3.new(0, 4, 0)
  287.             teleportToPosition(targetPosition)
  288.             wait(2) -- Wait for 1 second between teleports
  289.         end
  290.         wait(0.5) -- Check again after a short delay if no part found
  291.     end
  292. end
  293.  
  294. -- Function to stop the teleportation loop
  295. local function stopTeleporting()
  296.     teleporting = false
  297. end
  298.  
  299. -- Add buttons to start and stop the teleportation loop
  300. QuestsSection:NewButton("Squidward Secret Teleports", "Start teleporting to secret parts", function()
  301.     startTeleporting()
  302. end)
  303.  
  304.  
  305.  
  306. local Week1Section = Window:NewTab("Week 1"):NewSection("Teleport")
  307.  
  308. -- Function to teleport to a part
  309. local function teleportToPart(part)
  310.     local player = game.Players.LocalPlayer
  311.     if player and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  312.         local humanoidRootPart = player.Character.HumanoidRootPart
  313.         humanoidRootPart.CFrame = CFrame.new(part.Position + Vector3.new(0, 10, 0))
  314.     end
  315. end
  316.  
  317. -- Function to find parts with TouchInterest and teleport
  318. local function findAndTeleportWeek1()
  319.     local path = workspace.Programmables.Secrets.AnniversaryQuestW1
  320.     for _, part in ipairs(path:GetDescendants()) do
  321.         if part:IsA("BasePart") and part:FindFirstChildOfClass("TouchTransmitter") then
  322.             teleportToPart(part)
  323.             wait(2)
  324.         end
  325.     end
  326. end
  327.  
  328. Week1Section:NewButton("Teleport to Week 1 Instruments", "Teleports to parts in Week 1", function()
  329.     findAndTeleportWeek1()
  330. end)
  331.  
  332. local Week2Section = Window:NewTab("Week 2"):NewSection("Teleport")
  333.  
  334. -- Function to teleport to a part
  335. local function teleportToPart(part)
  336.     local player = game.Players.LocalPlayer
  337.     if player and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  338.         local humanoidRootPart = player.Character.HumanoidRootPart
  339.         humanoidRootPart.CFrame = CFrame.new(part.Position + Vector3.new(0, 10, 0))
  340.     end
  341. end
  342.  
  343. -- Function to find parts with TouchInterest and teleport
  344. local function findAndTeleportWeek2()
  345.     local path = workspace.Programmables.Secrets.AnniversaryQuestW2
  346.     for _, part in ipairs(path:GetDescendants()) do
  347.         if part:IsA("BasePart") and part:FindFirstChildOfClass("TouchTransmitter") then
  348.             teleportToPart(part)
  349.             wait(2)
  350.         end
  351.     end
  352. end
  353.  
  354. Week2Section:NewButton("Teleport to Week 2 Parts", "Teleports to parts in Week 2", function()
  355.     findAndTeleportWeek2()
  356. end)
  357.  
  358.  
Advertisement
Comments
  • flappywierdo49
    287 days (edited)
    # text 0.14 KB | 0 0
    1. Update: 7/16/2024 3:00 AM
    2. added Week 1 and 2, aswell as Auto Pickup, and Quests. Bug fixes include Lag spikes and tweening to coins multiple times.
Add Comment
Please, Sign In to add comment
Advertisement