pasje1312
(pasje1312)
June 12, 2023, 6:20pm
#1
I’m trying to make it so that when you activate something it will give you 1 or 2 but 2 needs to be more rare but maybe I will have a lot so I need to do this
random number
if 9 > 11 then
elsif then
end
You know what I mean is there a better way to do this
looks like youre trying to script a rarity system -
Hello devs! I am not much of a scripter so I was curious, how do I script a rarity system? I have searched far and wide and found nothing that is simple enough for what I need.
What I need is:
I am trying to make a game where you click on a button, and you have like a 50% chance of getting a “Common” badge, a 35% chance of getting an “Uncommon” badge, a 10% chance of getting a “Rare” badge, etc. There would be some really extensive badges like “Godlike” where the chance is something ridiculous…
So I’m making a game kinda like SCP 3008. And I’m trying to make a rarity system on the different rooms. Example: Bedroom’s chance of spawning = 5% and Cafeteria’s chance of spawning = 1%.
I have tried to make this using a Table. The given numbers are the chance they have to spawn.
local Rooms = {
"AppartmentModel" == 5; -- Chance for it to spawn
"BathRoom1" == 5;
"BedRoom" == 5;
"BedRooms" == 5;
"Beds" == 5;
"Carpets" == 5;
"ChildrensRoom" == 4;
"Coutches" == 5;
"Kitchen" == 3;
"Kit…
Geolio9
(Tomate)
June 12, 2023, 6:57pm
#3
I would generate a random number and the conditionals would be:
if num > 0.75 → 1
else → 2
pasje1312
(pasje1312)
June 12, 2023, 6:58pm
#4
yeah but thats the exact thing I dont want to make
Geolio9
(Tomate)
June 12, 2023, 6:59pm
#5
What is the problem with this solution?