sd-cases adds an engaging loot box/case opening system to your FiveM server. Players can obtain various types of cases from different activities (heists, robberies, etc.) and open them through an exciting spinning wheel interface to receive randomized rewards based on weighted probabilities.
Author: Samuel#0008
Discord: Join the Discord
Store: Click Here
- Interactive Spinning Wheel UI - Visually appealing case opening animation
- Multiple Case Types - 6 pre-configured case types with unique reward pools
- Weighted Reward System - Configurable probability weights for different rewards
- Flexible Reward Types - Support for both items and money rewards
- Customizable - Easy to add new cases or modify existing ones
- Smooth Animations - 8-second spin duration with 3-second cooldown
- Rarity Types - Common, Uncommon, Rare, Epic, Legendary and Mythic!
- Download the latest release from the GitHub repository. (NOT SOURCE)
- Extract the downloaded file and rename the folder to
sd-cases. - Place the
sd-casesfolder into your server'sresourcesdirectory. - Add
ensure sd-casesto yourserver.cfgto ensure the resource starts with your server.
For ox_inventory users, there are pre-written items for you below you can use if you want to use the default cases I made!
If you need to modify the UI or build from source, follow these instructions:
- Node.js (v16.0.0 or higher) - Download here
- npm (comes with Node.js)
- Navigate to the
webdirectory:
cd web- Install dependencies:
npm install- Build the UI for production:
npm run build- The built files will be generated in the
web/builddirectory
For development with hot-reload:
npm startThis will start the development server on http://localhost:3000
Note: The pre-built UI files are already included in releases, so you only need to build if you're modifying the UI code.
- ox_lib
Players can use any case item from their inventory to trigger the spinning wheel interface. The wheel will spin for 8 seconds before landing on a reward based on the configured weights.
Edit config.lua to customize:
- Spin duration and cooldown times
- Case types and their rewards
- Item weights (probability)
- Reward amounts
- UI colors and titles
The system automatically assigns rarity tiers based on drop chance percentages:
| Rarity | Percentage | Suggested Weight Range | Color |
|---|---|---|---|
| Common | ≥40% | 40+ | Gray |
| Uncommon | 25-39% | 25-39 | Green |
| Rare | 15-24% | 15-24 | Blue |
| Epic | 5-14% | 5-14 | Purple |
| Legendary | 1-4% | 1-4 | Gold |
| Mythic | <1% | <1 | Red |
Note: Percentages are automatically calculated based on the total weight of all items in a case. Higher weight values = higher chance of receiving that item.
Add these to your ox_inventory items.lua, if you want to use my default cases:
["fleeca_case"] = {
label = "Fleeca Bank Case",
weight = 2000,
stack = true,
close = true,
description = "A mysterious case from a Fleeca Bank heist. Contains random loot.",
consume = 0,
client = {
image = "case_1.png",
},
server = {
export = 'sd-cases.useFleeca_case',
}
},
["house_case"] = {
label = "House Robbery Case",
weight = 2000,
stack = true,
close = true,
description = "A case filled with items from house burglaries. Contents unknown.",
consume = 0,
client = {
image = "case_2.png",
},
server = {
export = 'sd-cases.useHouse_case',
}
},
["chopshop_case"] = {
label = "Chop Shop Case",
weight = 2500,
stack = true,
close = true,
description = "A case containing random car parts from the chop shop.",
consume = 0,
client = {
image = "case_3.png",
},
server = {
export = 'sd-cases.useChopshop_case',
}
},
["jewelry_case"] = {
label = "Jewelry Store Case",
weight = 1500,
stack = true,
close = true,
description = "A luxury case from Vangelico's. May contain valuable jewelry.",
consume = 0,
client = {
image = "case_4.png",
},
server = {
export = 'sd-cases.useJewelry_case',
}
},
["pacific_case"] = {
label = "Pacific Bank Case",
weight = 3000,
stack = true,
close = true,
description = "A high-security case from the Pacific Standard vault. Extremely valuable.",
consume = 0,
client = {
image = "case_5.png",
},
server = {
export = 'sd-cases.usePacific_case',
}
},
["casino_case"] = {
label = "Casino Heist Case",
weight = 2500,
stack = true,
close = true,
description = "A case stolen from the Diamond Casino vault. Contains premium loot.",
consume = 0,
client = {
image = "case_6.png",
},
server = {
export = 'sd-cases.useCasino_case',
}
},To add a new case type:
- Add the case definition to
config.lua:
my_custom_case = {
name = 'Custom Case',
title = 'MY CUSTOM CASE',
titleColor = '#HEX_COLOR',
items = {
{
id = 1,
name = 'Item Display Name',
item = 'item_spawn_name', -- Optional for item rewards
weight = 50, -- Higher = more common
amount = 1, -- Display amount
reward = {
type = 'item', -- or 'money'
item = 'item_spawn_name', -- For item type
amount = 1, -- Actual reward amount
moneyType = 'cash' -- For money type (cash/bank)
}
},
-- Add more items...
}
}- Add the corresponding item to ox_inventory
- Add the case image to your inventory images
