DirkScripts Logo

Login With FiveM

Login

πŸ“š Dirk Lib
β€Ί
Modules
β€Ί

objects

Objects

ℹ️ Client Module - This can only be used on the client

lib.objects.register

Create a new object

lua
lib.objects.register(name, new_data)
Parameter TypeRequiredDescription
nameStringtrueUnique reference for object
new_dataObjecttrueOptions for the object, refer to Data Structure

lib.objects.get

Get information regarding an object

lua
local obj = lib.objects.get(name)
Parameter TypeRequiredDescription
idStringtrueUnique reference for the object

lib.objects.destroy

Completely remove an object

lua
lib.object.destroy(id)
Parameter TypeRequiredDescription
idStringtrueUnique reference for the object

Data Structure

This is the data structure of an object and the valid options

lua
{
    type = "ped",                 -- ped, vehicle, object, or weapon
    model = `a_f_m_bevhills_01`,  -- Model hash
    pos = vector4(0, 0, 0, 0),    -- Position (also accepts vector3)
    rotation = vector3(0, 0, 0),  -- Optional rotation
    renderDist = 50,              -- When to render the object
    freeze = true,                -- Freeze the entity in place
    collision = true,             -- Enable collision
    invincible = true,            -- Make entity invincible
    zone = {                      -- Optional: auto-spawn/despawn zone
        radius = 50,
        onEnter = function() end,
        onExit = function() end,
    },
    onSpawn = function(entity)    -- Called when entity spawns
    end,
    onDespawn = function(entity)  -- Called when entity despawns
    end,
}

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.