Categories > Exploiting > Scripts >

Help with for loop PLS

Posts: 14

Threads: 6

Joined: Feb, 2023

Reputation: 0

Posted

So theres this game called STRONGEST PUNCH SIMULATOR and i made a lil farm for it BUT

it uses a for loop and when i want to stop the farm with an toggle it just doesnt

it stops after all its children(orbs) dissapear

also i added cooldown so that i dont get banned so until i collect all the orbs new ones appear and the farm doesnt stop

PLS HELPP

  • 0

Posts: 663

Threads: 65

Joined: Oct, 2022

Reputation: 30

Replied

We can use getgenv

 

getgenv is a global variable which can be used as a bool, we can make a loop with a global variable like this.

 

getgenv().autofarm = false -- change this to true to start the loop

while getgenv().autofarm == true do
-- put your remote here
task.wait()
end
  • 0

Try the cheat launcher verve today ⬇

https://i.imgur.com/QdS8sQ5.png

Join Neuron Discord Server - https://discord.gg/harAKHv32K

Posts: 14

Threads: 6

Joined: Feb, 2023

Reputation: 0

Replied

@Pluto_Guy,

i tried that already

this is what i use for farm

worldcurrent = game:GetService("Players").LocalPlayer.leaderstats.WORLD.Value for i,v in pairs(game:GetService("Workspace").Map.Stages.Boosts[worldcurrent]:GetChildren()) do for a,b in pairs(v:GetChildren()) do game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = b.CFrame worldcurrent = game:GetService("Players").LocalPlayer.leaderstats.WORLD.Value

end end end

 

and this is the autofarm toggle

 

if (state) then getgenv().AutoFarm = true while true do wait() if getgenv().AutoFarm == true then farming() end end else getgenv().AutoFarm = false end

 

it doesnt stop until all the orbs are collected

  • 0

mliny

Mattress kidnapper 3000

Posts: 94

Threads: 14

Joined: Jan, 2023

Reputation: 7

Replied

@Cooldudepro,

 

local autofarm = 0 -- substitute the 0 for a 1 so you can activate it

 

while autofarm == 1 do

-- delete this comment and add your remote

wait(0.1)

end

  • 0

Posts: 14

Threads: 6

Joined: Feb, 2023

Reputation: 0

Replied

@mliny,

I dont think u understood what i said,the farm i use is using for i,v to get all the orbs from a folder

and it doesnt stop untill all the orbs are collected

Im already using the getgenv().toggle and what u replied with,look at the message above u to see what i use

 

  • 0

Haruka

STD Testing Center

Posts: 58

Threads: 3

Joined: Feb, 2023

Reputation: 5

Replied

this should work yea, let me know

 

function farming()

    worldcurrent = game:GetService("Players").LocalPlayer.leaderstats.WORLD.Value

    for i,v in pairs(game:GetService("Workspace").Map.Stages.Boosts[worldcurrent]:GetChildren()) do

        for a,b in pairs(v:GetChildren()) do

            if not getgenv().AutoFarm then return end  -- Exit the loop if AutoFarm is false

            game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = b.CFrame

            worldcurrent = game:GetService("Players").LocalPlayer.leaderstats.WORLD.Value

        end

    end

end

 

 

local AutoFarm = false  -- Set the initial value of AutoFarm to false

 

-- Define the toggle function

local function Toggle(state)

    AutoFarm = state

end

 

-- Run the farming loop

while true do

    wait()

    if AutoFarm then farming() end  -- Only run the farm if AutoFarm is true

end

 

 

 

 

 

  • 0

https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png

 

 

Posts: 14

Threads: 6

Joined: Feb, 2023

Reputation: 0

Replied

@Haruka, OMG TYSM UR A LIVESAVER ILYYYYYYYYYYYYYYYYYYYYYYY 

jsut gotta implement it inside my gui and thats it,ty sm bro ily❤❤❤

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )