i know how to do this
local num = math.Random(1,3) if num == 3 then end
but can i have something that does something like this
local chanceToDoThing = 10/100 --10%
and then it only does something 10% of the time
You can just insert a value into a table 10 times and make one of those values a different value and then you can detect chance:
For example:
local rng = Random.new() local tab= {'Rare', 'Common', 'Common', 'Common','Common', 'Common', 'Common','Common', 'Common', 'Common'} local function returnChance() local chance = rng:NextInteger(1, #tab) return tab[chance] end print(returnChance())