My script (maybe) assumes that the yes/no button in a Gui in PlayerGui was clicked even before the gui appears. Script:
for i = 1e+18, 1, -1 do
wait(.5)
print(i .. " Showing debts..")
if taxYes.MouseButton1Down or taxNo.MouseButton1Down then
break
end
end
if taxYes.MouseButton1Down or taxNo.MouseButton1Down then
wait(2)
unpaid_tax = unpaid_tax_datastore:GetAsync(player.UserId)
unpaid_tax_storage = unpaid_tax_datastorage:GetAsync(player.UserId)
debt = ((0 - plrInDebt.leaderstats.Cash.Value) + unpaid_tax or unpaid_tax_storage)
debtAmount.Text = "$" .. debt
end
I'll edit the question if you have a problem concerning the other scripts which are very long.

1 comment
Why do you need to use a for loop? Just use a while loop and put a for loop inside it.