I have an ‘Auto ___’ feature in my game, and I’m trying to have it disable and enable while the auto feature runs, but it won’t disable while the auto feature runs. Here is the code:
autoButton.MouseButton1Down:Connect(function()
if marketplaceService:UserOwnsGamePassAsync(localPlr.UserId, autoId) then
if inGame then return end
isInAuto = not isInAuto
print(isInAuto)
if isInAuto then
task.spawn(function()
while isInAuto do
local wager = wagerBox.Text
local mines = minesBox.Text
local aog = tonumber(amountOfGuesses.Text)
self:startGame(mines, wager)
local already = {}
for _ = 1, aog do
task.wait(0.5)
local guess
guess, already = getTrueGuess(already)
if self:trySlot(guess) ~= 'good' then
break
end
end
self:cashout()
task.wait(1)
end
end)
end
else
marketplaceService:PromptGamePassPurchase(localPlr, autoId)
end
end)
Specifically in the for loop does the ability to click the button in order to change the status of the ‘isInAuto’ variable. May someone help me? Happy Thanksgiving.