Hello Guest

# Reset Script

• 2 Replies
• 242 Views #### Jessjxx19

• • 1
• +0/-0 ##### Reset Script
« on: June 24, 2020, 11:44:27 am »
Hello! I am currently building a script but i need some help.
I want to include a function that stops my script and start it again ( like a reset ) at line 28

if (!win) then
losecount += 1
if losecount >= 5 then
-- I NEED A RESET FUNCTION HERE
end
into this script :

Code: [Select]
`chnc           = 75chance         = chncbasebet        = 1nextbet        = basebetbethigh        = truelosecount      = 0enablesrc      = truernd            = 0resetseedonbet = 2000stoponwin      = 10function dobet()rnd += 1if profit > stoponwin then    stop()end    if (win) then        if rnd > resetseedonbet then        rnd = 0         resetseed()        end    chance = chnc   nextbet = basebet   losecount = 0endif (!win) then   losecount += 1   if losecount >= 5 then       -- I NEED A RESET FUNCTION HERE   end   if (losecount > 1) then      nextbet = previousbet*2   chance = (1/(((nextbet+(nextbet-basebet))/nextbet)))*100   if chance < 49.5 then   chance = 49.5 end   bethigh = !bethigh      print ("LOSE")   print(nextbet)   print(chance)   print(profit)   print(bets)   else      nextbet = previousbet*2   chance = (1/(((basebet+nextbet))/nextbet))*100      if chance<49.5 then   chance=49.5 end   bethigh = !bethigh   print ("LOSE")   print(nextbet)   print(chance)   print(profit)   print(bets)endend end` #### Seuntjie

•     • 496
• +14/-2 ##### Re: Reset Script
« Reply #1 on: June 24, 2020, 02:08:59 pm »
To reset a script, you need to reset your own variables. You can do that by just setting them to their original values or using a function to do it.

I made a tutorial about a resumable script but you can use the initialize function to reset if you implement it correctly: https://forum.seuntjie.com/index.php?topic=2.msg2195#msg2195 #### svenjatzu

• • 3
• +0/-0 ##### Re: Reset Script
« Reply #2 on: June 26, 2020, 03:54:37 pm »
is it also possible to add a sleeptimer like wait 30-60 sec before reset the script?