Coin Spawning Rarities

When making a chance system, I recommend you use some sort of module, I personally recommend using LootPlan. It’s pretty easy to use and works well.

local ReplicatedStorage = game:GetService("ReplicatedStorage");
local LootPlan = require(ReplicatedStorage.LootPlan); --Put the LootPlan module in ReplicatedStorage.

local coinLootPlan = LootPlan.new("single"); --This makes a new loot plan
coinLootPlan:AddLoot("coin", 50); --This makes a new loot called "coin" with a 50% chance of dropping
coinLootPlan:AddLoot("coin2", 25); --This makes a new loot called "coin2" with a 25% chance of dropping
coinLootPlan:AddLoot("coin3", 5); --This makes a new loot called "coin3" with a 5% chance of dropping

function spawnCoin()
	local chosenCoin = coinLootPlan:GetRandomLoot(); --This will pick a random coin name from the loot pool we made above
	print(chosenCoin); --Now you can do with this as you will
end
spawnCoin();
1 Like