Item Creation
This page will outline and explain how to create and customize items within the script.
Creating a new item
Create a new section
Now that you are in the appropriate location, please proceed to create a new section in your specified category. These categories are purely for organizational purposes. Your resource will not break if you do not follow the categories.
Once you have selected a place to create your new section, please copy and paste the following:
Assigning an icon to your item
You must now assign an icon to your item. This icon should accurately reflect the name and purpose of the item itself. You can assign an icon by inputting a string into the itemImage
variable. This string must correspond to a valid image located within the settings > icons
folder. Please ensure that the string also includes the appropriate file extension, such as .png
or .jpg
.
Creating a take function for your item
Each item necessitates a take function. The content of this function will be executed when you collect the item from a vehicle's boot. This function can include any logic, provided that it returns a boolean value indicating whether the action was successful or not.
By default, z_boot offers four types of item functions, which are designed for object spawning, clothing management, weapon management, and command execution. Further details regarding these functions can be found later on this page.
The rationale behind enabling server owners to customize their functions is to facilitate the incorporation of their own custom functions and to ensure seamless integration with other resources.
Provided below is the template for the take function
Creating a return function for your item
Just as each item requires a take function, they also necessitate a return function. This function manages the action of placing an item back into a vehicle inventory. It can implement any logic, provided it returns a boolean value indicating whether the action was successful. By default z_boot offers various default examples of this function, which will be explained further later in this document.
Provided below is the template for the return function
Default item functionality
Each item requires you to create its unique functionality, z_boot offer multipe default functionalities you can easily copy and paste and made addition too without requiring knowledge of coding, These are all below and are explained.
Command Execution is one of the most straightforward functionalities available. This feature allows a command to be triggered by the resource, which doesnt require user input via chat. For instance, if you have a command that provides the player with spiketrips, you can execute this command using this functionality.
Please be aware that you do not need to use a /
to initiate the command; you only need to enter the command name itself.
Last updated