wasvendel_luckycases
wasvendel scripts
wasvendel_luckycases
wasvendel scripts
wasvendel_luckycases.wasvendel_luckycases folder into your server's resources directory.install.sql into your database.server.cfg after your framework core.Import install.sql into your database before starting the resource for the first time.
Edit config.lua to configure case types, rewards, coin settings, and admin permissions.
| Setting | Default | Description |
|---|---|---|
Config.Settings.cmd | case | Command used to open the lucky cases UI. |
Config.Settings.cmdLuckycoin | luckycoin | Admin command used to manage player coins. |
Config.CoinsAdmin | Configurable | Permissions for the coin admin command. |
| Command | Usage | Description |
|---|---|---|
/case | /case | Opens the lucky cases UI. |
/luckycoin | /luckycoin [id] [amount] | Manages player coins. |
Coin admin command access is controlled by Config.CoinsAdmin in config.lua.
All server exports listed below are safe to call from other resources.
| Export | Signature | Description |
|---|---|---|
GetCoins | (src) -> number | Gets the coin balance by server ID. |
GetCoinsByIdentifier | (identifier, charid) -> number | Gets the coin balance by identifier. |
AddCoins | (src, amount) -> boolean | Adds coins to a player. |
AddCoinsByIdentifier | (identifier, charid, amount) -> boolean | Adds coins by identifier. |
RemoveCoins | (src, amount) -> boolean | Removes coins from a player. |
RemoveCoinsByIdentifier | (identifier, charid, amount) -> boolean | Removes coins by identifier. |
SetCoins | (src, amount) -> boolean | Sets the exact coin balance. |
SetCoinsByIdentifier | (identifier, charid, amount) -> boolean | Sets coins by identifier. |
| Event | Payload | Description |
|---|---|---|
wasvendel_luckycases:openui | None | Opens the cases shop UI. |
wasvendel_luckycases:openAndRoll | None | Opens the UI and starts the roll animation. |
wasvendel_luckycases:checkLootcaseResult | None | Returns the loot case validation result. |
wasvendel_luckycases:refreshamount | None | Refreshes the coin balance in the UI. |
wasvendel_luckycases:Notify | None | Shows a notification. |
| Event | Payload | Description |
|---|---|---|
wasvendel_luckycases:checkplayer | None | Checks player access. |
wasvendel_luckycases:checkLootcase | None | Validates and opens a case. |
wasvendel_luckycases:collectreward | None | Collects the case reward. |
wasvendel_luckycases:refreshamounts | None | Refreshes coin amounts. |
Edit customevent.lua to handle custom reward types.
| Event | Payload | Description |
|---|---|---|
wasvendel_luckycases:customevent | identifier, item, count, label | Handles custom rewards. |