Brutal Scripts
YouTubeDiscordStore
  • 🙉About Us
  • ↗️Translate
  • Informations
    • 🔒Escrow System
    • 🔥Common Problems
  • Scripts
    • 📄Notify
      • Accessible files
      • Installation guide
    • 🔠Text-UI
      • Installation guide
      • Exports & How to use
      • Integrations
    • 🤟Gangs
      • Accessible files
      • Installation guide
      • exports / triggers
      • Create a new gang
    • 🏡Housing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔑Keys
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💥Gang Actions
      • Accessible files
      • Installation guide
      • exports / triggers
      • Controlling the menu
    • ⭕Radial
      • Accessible files
      • Installation guide
      • Adding new buttons
    • 🎯Executions
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🐶Pets + K9 V2
      • Accessible files
      • Installation guide
    • 👮Police Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🚑Ambulance Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔧Mechanic Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💪GYM with Skills V2
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔫Paintball
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🥊Boxing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔨Crafting
      • Accessible files
      • Installation guide
      • Creating a new crafting table
    • 🏦Banking
      • Accessible files
      • Installation guide
      • Paycheck transactions
      • Registering transactions
    • 🎳Bowling
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🦌Hunting
      • Accessible files
      • Installation guide
    • 🏁Racing Script
      • Accessible files
      • Installation guide
    • 🐛Reports
      • Accessible files
      • Installation guide
    • 🛒Shop Robbery
      • Accessible files
      • Installation guide
    • 🛥️Yacht Heist
      • Accessible files
      • Installation guide
    • 🧾Billing
      • Accessible files
      • Installation guide
      • Triggers
    • 💰Truck Robbery
      • Accessible files
      • Installation guide
    • 🏧Atm Robbery
      • Accessible files
      • Installation guide
    • 👶Baby script
      • Installation guide
      • How to add more babys
  • Others
    • Register Key Mapping
    • Drill Minigame
    • Discord Webhook
Powered by GitBook
On this page
  • Client Exports
  • Server Triggers
  • How to use custom keys

Was this helpful?

  1. Scripts
  2. Keys

exports / triggers

Client Exports

Export
Result

exports.brutal_keys:addKey(keyID, label)

Give key to the player. Create a key for anything. The label can be anything. (Won't work with vehicles)

exports.brutal_keys:removeKey(keyID, deleteAll)

Remove key from the player. deleteAll: true/false - if true then it will felete all the keys with this keyID from the player

exports.brutal_keys:addVehicleKey(plate, label)

Give vehicle key to the player. The label can be anything.

exports.brutal_keys:addVehicleTemporaryKey(hours, plate, label)

Give a temporary key to the plaer to the vehicle. After the given hours it will be removed. The label can be anything.

exports.brutal_keys:getPlayerKey(keyID)

Return two values

hasKey: true/false - Wether the player has the key or not. quantity: number - if has the key then the quantity.

Server Triggers

Export
Result

TriggerEvent('brutal_keys:server:addKey', PlayerID, keyID, label)

Give key to the player. Create a key for anything. (Won't work with vehicles)

TriggerEvent('brutal_keys:server:removeKey', PlayerID, keyID, deleteAll)

Remove key from the player. deleteAll: true/false - if true then it will felete all the keys with this keyID from the player

TriggerEvent('brutal_keys:server:addVehicleKey', PlayerID, plate, label)

Give vehicle key to the player

TriggerEvent('brutal_keys:server:addVehicleTemporaryKey', PlayerID, hours, plate, label)

Give a temporary key to the plaer to the vehicle. After the given hours it will be removed.

How to use custom keys

Client side example!

Here is an exmple how to create a custom key for a stash for example.

  • How to give a key to a player to anything

local StashName = "stash_1"
exports.brutal_keys:addKey(StashName.."_key", "Chest Key")
  • How to get if the player have a key for the stash or not

local keyID = "stash_1_key"
local hasKey,quantity = exports.brutal_keys:getPlayerKey(keyID)

if hasKey then 
    exports.ox_inventory:openInventory('stash', { id = "stash_1"})
else
    -- Dont have key for the stash
end
PreviousInstallation guideNextGang Actions

Last updated 7 days ago

Was this helpful?

🔑
Page cover image