Configuration
Configuration
Everything below is in config.lua — the only file you need to edit. Save, restart the resource, done.
Master switch
Config.Enabled = true
Set to false to disable everything at runtime — both commands and right-click options silently no-op, players see a "Funcion deshabilitada" notification if they try to use them. Useful for special RP events or maintenance windows without removing the resource.
Permission system
Config.RequirePermission = false -- false = everyone | true = admin-granted only
Config.PersistGrants = true -- save grants across restarts
Config.AdminGroup = 'group.admin'
Config.RequirePermission |
Behavior |
|---|---|
false (default) |
Everyone can use /slap and /patada freely (still subject to cooldown + VIP rules) |
true |
Only players an admin has granted via /slapperm <id> on can use them |
When true, grants are stored by license and survive restarts when Config.PersistGrants = true (uses FiveM's built-in KVP — no database needed). If PersistGrants = false, grants reset on every restart and admins must re-grant.
Config.AdminGroup is the ACE / group string used to gate the /slapperm admin command itself. Defaults to group.admin. Set to group.mod if you want moderators to grant too, or any custom ACE group you've defined in your server config.
Command names
Rename any of the three commands without touching anything else:
Config.Commands = {
Slap = 'slap', -- /slap
Patada = 'patada', -- /patada
Perm = 'slapperm', -- /slapperm <id> on/off
}
For example, set Slap = 'bofetada' to register /bofetada instead of /slap. The right-click options and notifications keep working — only the chat command changes.
Command help text
Shown in the F8 chat suggestion popup as players type:
Config.CommandHelp = {
Slap = 'Dar una cachetada al jugador mas cercano',
Patada = 'Dar una patada en la entrepierna al jugador mas cercano',
Perm = 'Otorgar o quitar permiso de slap/patada a un jugador (admin)',
}
Translate these freely — they only affect the suggestion popup, not any logic.
Right-click target integration
Config.UseTarget = true
Config.TargetSystem = 'ox_target' -- 'ox_target' | 'qb-target'
Config.UseTarget |
Effect |
|---|---|
true (default) |
Adds "Bofetear" and "Patada" right-click options when targeting another player. Same cooldown, same permission rules. |
false |
Only the chat commands work. |
Config.TargetSystem picks which targeting resource to register against. The chosen one must be started — if it isn't, the options silently fail to register and chat commands still work normally.
Quick reference
| Want to… | Set |
|---|---|
| Disable the whole resource temporarily | Config.Enabled = false |
| Restrict use to specific players only | Config.RequirePermission = true |
| Persist permissions across restarts | Config.PersistGrants = true (default) |
| Let moderators grant permissions too | Config.AdminGroup = 'group.mod' |
Rename /slap to /bofetada |
Config.Commands.Slap = 'bofetada' |
| Disable right-click options | Config.UseTarget = false |
| Switch from ox_target to qb-target | Config.TargetSystem = 'qb-target' |
Anything beyond config.lua (animations, cooldown duration, sound radius, VIP whitelist, etc.) is part of the protected build. Open a ticket in Discord if you need a setting exposed.
