Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
- local Window = Library.CreateLib("Auto Farm Gui", "DarkTheme")
- local Tab = Window:NewTab("Auto Farm")
- local Section = Tab:NewSection("Auto Farm")
- Section:NewButton("use before using auto farm and click again if you died", "ButtonInfo", function()
- local player = game:GetService("Players").LocalPlayer
- local proximityRadius = 50
- local activationInterval = 00.1
- local function activateProximityPrompts()
- local character = player.Character or player.CharacterAdded:Wait()
- local rootPart = character:WaitForChild("HumanoidRootPart")
- while true do
- for _, v in pairs(game:GetService("Workspace"):GetDescendants()) do
- if v:IsA("ProximityPrompt") then
- local distance = (rootPart.Position - v.Parent.Position).Magnitude
- if distance <= proximityRadius then
- fireproximityprompt(v)
- end
- end
- end
- wait(activationInterval)
- end
- end
- activateProximityPrompts()
- end)
- Section:NewButton("Auto Farm", "ButtonInfo", function()
- local player = game:GetService("Players").LocalPlayer
- local teleportInterval = 0.5
- local function getRandomObjectWithHumanoidRootPart(folder)
- local objectsWithRootPart = {}
- for _, obj in ipairs(folder:GetChildren()) do
- if obj:IsA("Model") and obj:FindFirstChild("HumanoidRootPart") then
- table.insert(objectsWithRootPart, obj)
- end
- end
- if #objectsWithRootPart > 0 then
- return objectsWithRootPart[math.random(1, #objectsWithRootPart)]
- else
- return nil
- end
- end
- local function teleportToRandomObject()
- local toiletsFolder = game:GetService("Workspace").Toilets
- if toiletsFolder then
- while true do
- local randomToilet = getRandomObjectWithHumanoidRootPart(toiletsFolder)
- if randomToilet then
- player.Character:SetPrimaryPartCFrame(randomToilet.HumanoidRootPart.CFrame)
- end
- wait(teleportInterval)
- end
- end
- end
- teleportToRandomObject()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement