-- Rank simulator X luck calculator
-- all of this is to be put in program input
-- follow instructions below or ask shootthecreeper if unclear
-- inputs : *MAKE SURE EACH ANSWER IS ITS OWN LINE!*
-- input how many luck upgrades you own
local Upg = io.read("*line")
-- do you have the luck gamepase? 'Yes' or 'no'
local Lpass = io.read("*line")
-- if you are calculating for secret chance put 'Yes' or 'No' if you are *NOT* put 'No'
local Spass = io.read("*line")
-- is there a luck boost? put 'Yes' or 'No'
local Levent = io.read("*line")
-- you are done! press the RUN button, if theres any issues ask for help
-- if statements
if Upg == 0 then
UpgF = 1
else
UpgF = (Upg * 1.25)
end
if Lpass == 'no' or Lpass == 'No' then
LpassF = 1
elseif Lpass == 'Yes' or Lpass == 'yes' then
LpassF = 2
else
print("Please put in a proper value for the luck gamepass.")
end
if Spass == 'no' or Spass == 'No' then
SpassF = 1
elseif Spass == 'Yes' or Spass == 'yes' then
SpassF = 2
else
print("Please put in a proper value for the secret gamepass.")
end
if Levent == 'no' or Levent == 'No' then
Leventf = 1
elseif Levent == 'Yes' or Levent == 'yes' then
Leventf = 2
else
print("Please put in a proper value for the luck event.")
end
-- calculations
local luck = (UpgF * LpassF * SpassF * Leventf)
print('Your luck multiplier is ' .. luck .. 'x')
print("")
-- individual luck
print("Individual luck boosts: ")
print("")
print("Luck Upgrade " .. UpgF .. "x")
print("Luck Gamepass " .. LpassF .. "x")
print("Secret Gamepass " .. SpassF .. "x")
print("Luck Event " .. Leventf .. "x")
print("")
-- secret chance
local Schance = (1000000 / luck)
if Schance == 100000 then
Schance = '100K'
else
Schance = Schance
end
print("Your secret chance is 1/" .. Schance)
To embed this project on your website, copy the following code and paste it into your website's HTML: