Roblox Generic Roleplay Gaem Script Auto Farm

Roblox Generic Roleplay Gaem Script Auto Farm

Script By Jojoaut8

local currentamount = 0
function getfuncs(scrpt, replacefunc)
    local rt = {}
    for _,i in pairs(getreg()) do
        if type(i) == "function" then
            if getfenv(i).script == scrpt then
                table.insert(rt,i)
                if replacefunc ~= nil then
                    getreg()[_] = replacefunc
                    print("whoa")
                end
            end
        end
    end
    return rt
end
local messagefunc = getfuncs(game.Players.LocalPlayer.PlayerScripts.EventClientHandler)[1]
messagefunc("Event","Loading Jojoaut8s autofarm for grg",10)
function getcurrentfoodamount()
    function round(n)
   return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
end
   local p = game.Players.LocalPlayer
   local c = p.Character
   local b = p.Backpack
   local part
   if b:FindFirstChild("steal food") ~= nil then
   part = b["steal food"].Food 
   end
    if c:FindFirstChild("steal food") ~= nil then
   part = c["steal food"].Food 
      end
    if part == nil then return 0 end
    return round(-((part.Transparency-1)*10))/2
end
spawn(function() 
while wait() do
   pcall(function()
       game.Players.LocalPlayer.Character.HumanoidRootPart.HeadGui:Destroy()
    end) 
end
end)
local lp = game.Players.LocalPlayer
local tptoggle = false
local FoodSupplies = game.Workspace.FoodSupplies
local GlobalToggle = false
FoodSupplies.BarbSupply.FoodLevel.CanCollide = false
FoodSupplies.TownSupply.FoodLevel.CanCollide = false


function activate()

    if lp.Character:FindFirstChild("steal food") ~= nil then
        lp.Character["steal food"]:Activate()
    else if lp.Backpack:FindFirstChild("steal food") ~= nil then
        lp.Backpack:FindFirstChild("steal food").Parent = lp.Character
        lp.Character:FindFirstChild("steal food"):Activate()
    end
    end
end
local LIB = loadstring(game:HttpGet("https://pastebin.com/raw/67sh8P8E"))()
local TELEPORTS = LIB:CreateWindow({text = "Teleports"})
local AUTOFARM = LIB:CreateWindow({text = "AUTOFARM"})
TELEPORTS:AddButton("Town food bowl", function()
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.TownSupply.FoodLevel.CFrame
end)
TELEPORTS:AddButton("Barb food bowl", function()
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.BarbSupply.FoodLevel.CFrame
end)
AUTOFARM:AddButton("Steal Food once", function()
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.TownSupply.FoodLevel.CFrame

    while currentamount < 5 and wait() do
        activate()
        currentamount = getcurrentfoodamount()
        print(currentamount)
        local magnitude = (lp.Character.HumanoidRootPart.Position - FoodSupplies.TownSupply.FoodLevel.Position).Magnitude
        if magnitude > 5 then
                lp.Character.HumanoidRootPart.CFrame = FoodSupplies.TownSupply.FoodLevel.CFrame
        end
    end
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.BarbSupply.FoodLevel.CFrame
    wait(1)
    activate()
    while getcurrentfoodamount() == 5 do
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.BarbSupply.FoodLevel.CFrame
    activate()
    wait(1)
    end
end)
AUTOFARM:AddToggle("Autofarm", function(tog)
    if tog == true then
        GlobalToggle = true
    end
    if tog ~= true then
        GlobalToggle = false
    end
end)
messagefunc("Notification","Done loading, Have fun and make sure to vouch and +rep",10)
while wait() do
    if GlobalToggle == true then
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.TownSupply.FoodLevel.CFrame

    while currentamount < 5 and wait() do
        activate()
        currentamount = getcurrentfoodamount()
        print(currentamount)
        local magnitude = (lp.Character.HumanoidRootPart.Position - FoodSupplies.TownSupply.FoodLevel.Position).Magnitude
        if magnitude > 5 then
                lp.Character.HumanoidRootPart.CFrame = FoodSupplies.TownSupply.FoodLevel.CFrame
        end
    end
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.BarbSupply.FoodLevel.CFrame
    wait(1)
    activate()
    print(getcurrentfoodamount())
    while currentamount == 5 do
    lp.Character.HumanoidRootPart.CFrame = FoodSupplies.BarbSupply.FoodLevel.CFrame
    activate()
    wait(1)
            currentamount = getcurrentfoodamount()

    end
    end
end
%d bloggers like this: