Creating a New Script

This guide uses 120kw_diving as a template to teach you how to build your own functional scripts within the 120kw framework.

Case Study: 120kw_diving

The diving script follows the standard structure: configuration, client-side logic for the UI, and server-side validation.

Step 1: Configuration

shared/config.lua
Config = {}
Config.DivingLocations = {
    { x = 120.0, y = -120.0, z = 0.0, label = "Diving Spot 1" }
}
Config.PricePerGear = 500

Step 2: Client Logic

Handle the interaction and UI triggers.

RegisterNetEvent('120kw_diving:startDiving')
AddEventHandler('120kw_diving:startDiving', function()
    -- Start diving logic
    print("Diving started")
end)

Building Your Own

To create a different script (e.g., a "Fishing" script), simply follow the same pattern:

"Duplicate the structure, rename the events, and update the logic while keeping the 120kw standards."