DirkScripts Logo

Login With FiveM

Login

📚 Library
â€ē

DevTools

DevTools

â„šī¸ Client Module

A suite of in-game developer tools accessible via the /devtools command or individually by their own slash commands. Tools are registered with the DevTool class and can be extended with custom entries.

/devtools

Opens a context menu listing all registered dev tools alphabetically.

Built-in Tools

/vector4

Copies your current position and heading as a vector4(x, y, z, heading) to the clipboard.

/vector3

Copies your current position as a vector3(x, y, z) to the clipboard.

/vector2

Copies your current position as a vector2(x, y) to the clipboard.

/camPos

Copies the camera position and rotation to the clipboard.

/getPosition

Interactive point placement tool. Place one or multiple points with a visual marker, then copies the coordinates to the clipboard.

Controls: E add point, G cancel, B delete last point, LMB confirm all (multi mode).

/placeEntity

Interactive entity placement tool with rotation controls. Spawns an entity, lets you position it, then copies the final position and rotation to the clipboard.

/polygonCreator

Interactive polygon point creator with adjustable height. Place points to define a polygon boundary, then copies the formatted points to the clipboard.

Controls: E add point, G cancel, B delete last, ↑/↓ adjust height, LMB confirm.

/viewModels

Toggles the display of nearby object model names and health as 3D text above each prop.


DevTool API

DevTool.register

Register a custom dev tool.

lua
DevTool.register('myTool', {
    label = 'My Tool',
    description = 'Does something useful',
    icon = 'wrench',
    action = function()
        print('Tool activated')
    end,
    command = true, -- also registers /myTool command
})
PropertyTypeRequiredDescription
labelstringyesDisplay label in menu
descriptionstringyesDescription text
iconstringyesIcon name
actionfunctionyesFunction to run when selected
commandbooleannoAlso register as a /name slash command

DevTool.get

Get a registered dev tool by name.

lua
local tool = DevTool.get('myTool')

DevTool.getAll

Get all registered dev tools.

lua
local tools = DevTool.getAll()

DevTool.delete

Remove a registered dev tool.

lua
DevTool.delete('myTool')

Exported Functions

lib.getPosition

Interactive point placement. Returns placed coordinate(s) or false if cancelled.

lua
local pos = lib.getPosition()                    -- single point → vector3
local positions = lib.getPosition(true)          -- multiple points → formatted string
local bounded = lib.getPosition(true, 50.0)      -- max 50 units from start
local inZone = lib.getPosition(false, polyTable) -- constrained to polygon
ParameterTypeRequiredDescription
multiplebooleannoCollect multiple points before confirming
boundstable | numbernoPolygon table for boundary check, or max distance from starting point

Returns: vector3 (single), string (multiple, formatted), or false (cancelled)

lib.placeEntity

Interactive entity placement.

lua
local result = lib.placeEntity('object', 'prop_bench_01a', 50.0, true)
if result then
    print(result.pos, result.rot)
end
ParameterTypeRequiredDescription
_typestringyes'object', 'vehicle', or 'ped'
model_namestringyesModel name to spawn
boundsnumber | tablenoDistance or polygon constraint
networkedbooleannoCreate a networked entity

Returns: { rot: vector3, pos: vector4 } or false if cancelled. Also copies to clipboard.

lib.createPolygon

Interactive polygon creation.

lua
local polygon = lib.createPolygon()
if polygon then
    print(polygon) -- formatted point string
end
ParameterTypeRequiredDescription
boundstable | numbernoBoundary constraint

Returns: string (formatted polygon points) or false if cancelled.

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.