GiveKeys
The GiveKeys
export allows you to assign vehicle keys to a player for a specified vehicle. This is particularly useful for third-party assets, such as vehicle shops, to grant ownership access.
Obtain the Plate Natively
To use the GiveKeys
export effectively, you need the vehicle's plate and model. Here is a simple code snippet to obtain these values natively:
With these values, you can seamlessly integrate the export into your script.
How to Use
To give keys to a player, use the following code:
plate: The license plate of the vehicle.
model: The model of the vehicle.
bypassKeyCheck: (optional) A boolean value that, if set to
true
, bypasses the key validation check. By default, it is set tofalse
.
Example
Here is an example of how to use the GiveKeys
export in a vehicle shop script:
This export simplifies the process of assigning keys to players, making it ideal for use in scenarios like vehicle purchases, rentals, or administrative commands. Integrate it with the plate and model retrieval logic to ensure a smooth experience.
Last updated