r_casino Creating Cases
Build r_casino loot cases in config.lua: items, weapons, vehicles and cash rewards, rarities, Discord role limits, cooldowns and case images.
The entire case catalog is one list in config.lua: R.Cases. The server rolls the winning item from this list, so it is the single source of truth for prices, contents and restrictions.
Anatomy of a Case
{
name = "Weapon Case", -- display name of the case
value = "weaponcase", -- unique key
price = 500, -- cost in coins
image = "media/case.png", -- case artwork (media/... or a full URL)
requiredRole = nil, -- Discord role id needed to open (nil = everyone)
tag = nil, -- small badge shown on the card, e.g. "VIP"
cooldownHours = 0, -- hours between openings per player (0 = none)
contains = {
{ name = "Vintage Pistol", value = "weapon_vintagepistol", type = "weapon", rarity = "common", image = "media/WEAPON_VINTAGEPISTOL.png" },
{ name = "Pistol .50", value = "weapon_pistol50", type = "weapon", rarity = "rare", image = "media/WEAPON_PISTOL50.png" },
{ name = "C4 Charge", value = "c4", type = "item", rarity = "epic", image = "media/c4.png" },
{ name = "SMG", value = "weapon_smg", type = "weapon", rarity = "legendary", image = "media/WEAPON_SMG.png" },
},
},Reward Types
value is the item or weapon name in your inventory system:
{ name = "Body Armor", value = "armor", type = "item", rarity = "rare", image = "media/armor.png" },
{ name = "SMG", value = "weapon_smg", type = "weapon", rarity = "legendary", image = "media/WEAPON_SMG.png" },Rarities
Every item needs one of the four rarities. They control both the roll odds (see Games → Cases) and the card colours in the UI:
| Rarity | Default chance | Colour |
|---|---|---|
common | 50% | Grey-blue |
rare | 35% | Blue |
epic | 12% | Purple |
legendary | 3% | Pink |
Restricting a Case
Discord role
Lock a case to a Discord role (requires R.Discord.Enabled = true and trase_discord or Badger_Discord_API):
requiredRole = "1303080734486958105",
tag = "VIP", -- optional badge so players see it's restrictedCooldown
Limit how often each player can open a case:
cooldownHours = 24,The cooldown is tracked per player in the r_casino_case_cooldowns table and shown as a badge on the case card.
Images
Case and item images can be:
- Local files: drop them in the resource's
web/build/media/folder and referencemedia/yourimage.png - URLs: any hosted image, e.g.
https://your-cdn.com/case.png
media/case.png artwork ships with the resource. Replace the reference in the config with your own artwork whenever you like.