๐ Slot Calculation#
A player's total slots are calculated as:
Total Slots = Default + Database + Discord + Custom License
| Source | Description |
|---|---|
| Default | Config.DefaultCharacterSlots value |
| Database | Slots stored in 0r_multicharacterv3 table |
| Discord | Bonus slots from Discord roles |
| Custom License | Bonus slots from specific license IDs |
๐ข Default Slots#
Set the base slot count for all players:
Config.DefaultCharacterSlots = 1 -- Everyone starts with 1 slot
๐ฎ Discord Role Slots#
Grant bonus slots based on Discord roles:
Config.CharacterSlots = {
Discord = {
status = false, -- Enable Discord slot system
roles = {
{
id = 1234567890123456, -- Discord Role ID
slot = 1, -- Bonus slots
},
{
id = 9876543210987654, -- VIP Role
slot = 3, -- +3 bonus slots
},
}
},
-- ...
}
Setup Requirements#
- Install a Discord bot/integration that provides role checking
- Configure your Discord guild ID
- Add role IDs and corresponding slot bonuses
How to Get Role IDs#
- Enable Developer Mode in Discord (Settings โ Advanced)
- Right-click the role โ Copy ID
Players receive slots from their highest applicable role, not cumulative.
๐ณ Tebex Integration#
Sell character slots through your Tebex store:
Config.CharacterSlots = {
Tebex = {
status = false, -- Enable Tebex integration
packages = {
{
id = 1, -- Tebex package ID
slot = 1, -- Slots to grant
},
{
id = 2, -- Premium package
slot = 5, -- +5 slots
},
}
},
-- ...
}
Tebex Setup#
- Create a package in your Tebex store
- Note the package ID
- Add it to the packages list
- Configure Tebex API in
server/tebex.lua
How Players Redeem#
- Player purchases package on Tebex
- Tebex provides a redemption code
- Player enters code in the character selection UI
- Slots are added to their account
๐ Custom License Slots#
Grant slots to specific license identifiers (useful for staff/VIPs):
Config.CharacterSlots = {
Custom = {
status = false, -- Enable custom license system
licenses = {
{
id = 'license:abc123def456', -- Full license identifier
slot = 5, -- Bonus slots
},
{
id = 'license:xyz789ghi012', -- Another player
slot = 10, -- Staff gets 10 extra
},
}
},
}
How to Get License IDs#
In-game, run:
print(GetPlayerIdentifierByType(source, 'license'))
Or check your database players table.
๐๏ธ Redeemable Codes#
Create one-time use codes that grant slots:
Adding Codes via Database#
INSERT INTO 0r_multicharacterv3_code (code, slot) VALUES
('WELCOME2024', 1),
('VIPBONUS', 3),
('STREAMER5', 5);
Adding Codes via Command#
Create a command in server/commands.lua:
lib.addCommand('addslotcode', {
help = 'Add a slot redemption code',
params = {
{ name = 'code', help = 'The code', type = 'string' },
{ name = 'slots', help = 'Number of slots', type = 'number' },
},
restricted = 'group.admin',
}, function(source, args)
MySQL.insert('INSERT INTO 0r_multicharacterv3_code (code, slot) VALUES (?, ?)', {
args.code, args.slots
})
print('Code created: ' .. args.code .. ' (' .. args.slots .. ' slots)')
end)
๐ Complete Configuration Example#
Config.DefaultCharacterSlots = 2
Config.CharacterSlots = {
-- Tebex Store Integration
Tebex = {
status = true,
packages = {
{ id = 12345, slot = 1 }, -- Basic slot package
{ id = 12346, slot = 3 }, -- Premium package
{ id = 12347, slot = 5 }, -- Ultimate package
}
},
-- Discord Role Rewards
Discord = {
status = true,
roles = {
{ id = 1111111111111111, slot = 1 }, -- Supporter
{ id = 2222222222222222, slot = 2 }, -- VIP
{ id = 3333333333333333, slot = 5 }, -- MVP
{ id = 4444444444444444, slot = 10 }, -- Staff
}
},
-- Manual License Assignments
Custom = {
status = true,
licenses = {
{ id = 'license:owner123', slot = 99 }, -- Server owner
}
}
}
โก Admin Commands#
Add slots directly to players via commands:
-- In server/commands.lua
lib.addCommand('addslots', {
help = 'Add slots to a player',
params = {
{ name = 'id', help = 'Player ID', type = 'playerId' },
{ name = 'amount', help = 'Slots to add', type = 'number' },
},
restricted = 'group.admin',
}, function(source, args)
local identifier = GetPlayerIdentifierByType(args.id, 'license2')
MySQL.update('UPDATE 0r_multicharacterv3 SET character_slot = character_slot + ? WHERE identifier = ?', {
args.amount, identifier
})
end)
โ FAQ#
Q: Do Discord slots stack with Tebex slots? A: Yes! All sources are additive.
Q: What happens if a player has multiple Discord roles? A: They receive slots from the role with the highest slot value.
Q: Can slots be removed? A: Yes, modify the database directly or create a remove command.