How do I make a luck boost system similar to this?

If you know Sol’s RNG , you know that it has a timed luck system to increases the player’s luck, and when it runs out, it decreases the luck by the same amount as the increase. How would I go about recreating this system?

Include script examples, and explanations. Got any questions? Ask me!

1 Like

I’m not familiar with the game, but I can try my best to help.
Here’s a simple script I wrote that might be similar to what you’re looking for.

-- Variables
local timer = 1000
local luck = 1
local increase = 0

-- Repeats until timer runs out
while timer ~= 1000 do
  timer -= 1

  -- Every 5 seconds, increase luck
  if timer % 5 == 0 then
    luck += 1
    increase += 1
  end

  -- If timer has ended, return luck back to normal
  if timer == 0 then
    luck -= increase
  end
end

If the timer is set to 1000 at the start like that, the while loop will never be true to start with.
maybe … just guessing

local timer = 1000
local luck = 1
local increase = 0

while timer > 0 do
  timer -= 1
  if timer % 5 == 0 then
    luck += 1
    increase += 1
  end
  if timer == 0 then -- not sure how this would fit in here ...
    luck -= increase
  end
end

so sorry LOL i wasnt thinking that much when i wrote that but yeah pretty much

1 Like

Thank you! This worked REALLY well!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.