[standalone] gizmo | free

This is a simple gizmo for RedM.
Can be useful for creating an intuitive experience in decoration systems.

Example - Camera Mode Enabled
Example - Camera Mode Disabled

Export (Client)

You can override the config via the export

  • EnableCam: Enable/Disable camera mode
  • MaxDistance: Override the MaxDistance
  • MinY: Override the MinY (Camera Mode)
  • MaxY: Override the MaxY (Camera Mode)
  • MovementSpeed: Override movement speed (Camera Mode)
--- Toggle the gizmo on the entity
--- @param Entity number
--- @param Config table
--- @param fn function | nil
--- @return table
local data = exports.gs_gizmo:Toggle(Entity, {
    EnableCam = true,
    MaxDistance = 100,
    MinY = -40,
    MaxY = 40,
    MovementSpeed = 0.1
}, 
function(pos)
    -- You can hook in a function to block/allow gizmo movement
    -- pos: vec3
    -- return: boolean
    return true
end)

Data is returned in the following format:

{
    "coords": {
        "x": -233.07241821289063,
        "y": 602.7467651367188,
        "z": 112.32718658447266
    },
    "rotation": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "entity": 969988
}

PR’s are always welcome.

Other Resources

[PAID] GS-BANKROBBERY
[PAID] GS-MOONSHINING
[PAID] GS-GANGWARS
[FREE] GS-DOORLOCKS
[FREE] GS-GANGS

Code is accessible Yes
Subscription-based No
Lines (approximately) ~500
Requirements N/A
Support Yes
3 Likes

Updated 1.0.4

  • Added the ability to restrict both the camera and gizmo separately via config and export.
  • Added the ability to disable the gizmo distance limit by setting ‘MaxDistance’ to false.
  • Added drag and drop support for outsider scripts using ‘object_gizmo’ resource.
  • Added the hooked function used in the export to not only restrict the gizmo but also the camera. Use cases would be for things such as decorating in a polyzone and preventing both the gizmo and camera from leaving the boundary.
local data = exports.gs_gizmo:Toggle(Entity, nil, function(pos)
    -- pos coords are out of polyzone
    -- works for both the camera and gizmo
    return false
end)