ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
Natives Explorer

FiveM Natives Explorer

FiveM natives documented the way they should be — real Lua examples, return values, and the pitfalls that actually trip people up.

GetPlayerPedReturns the ped handle for a given player index. Use PlayerPedId() for the local player instead — it's faster …
client
GetEntityCoordsReturns the world coordinates (vector3) of any entity — ped, vehicle, or object.
client
TriggerServerEventFires a registered event on the server from the client. The primary way the client asks the server to do somet…
client
TriggerClientEventFires a registered event on a client (or all clients) from the server. The server's way to tell clients what h…
server
RegisterNetEventRegisters an event that can be triggered across the network (client↔server). Required for any event triggered …
shared
PlayerPedIdReturns the ped handle for the local player. The fastest, simplest way to reference the current player's chara…
client
SetEntityCoordsMoves an entity (ped, vehicle, or object) to specific world coordinates. The standard native for teleporting p…
client
RegisterCommandRegisters a chat or console command with a handler function. Works on client or server. The standard way to ad…
shared
GetHashKeyConverts a string (model name, weapon name, etc.) into its integer hash, which most natives require. In modern…
shared
CreateVehicleCreates a vehicle of a given model at a position. On modern FiveM, prefer creating networked vehicles server-s…
server
RequestModelRequests a model to be loaded into memory before you can spawn or use it. Pair with HasModelLoaded in a wait l…
client
GetEntityHealthReturns the current health of an entity (ped, vehicle). For peds, 0 is dead and ~200 is full by default.
shared
SetEntityHealthSets an entity's health. Common for healing or damaging peds. Use GetEntityMaxHealth to fully heal.
client
GiveWeaponToPedGives a weapon to a ped, optionally with ammo. Used for loadouts, admin tools, and job equipment.
client
GetPlayerNameReturns the display name of a player by their ID. On the server, pass the source/player ID.
shared
GetPlayerIdentifiersReturns a table of a player's identifiers (license, steam, discord, ip, etc.). The reliable way to identify a …
server
GetVehiclePedIsInReturns the vehicle a ped is currently in (or the last vehicle). Returns 0 if none.
client
DrawText / BeginTextCommandDisplayTextDraws 2D text on screen. Must be called every frame while visible. Modern FiveM uses the BeginTextCommandDispl…
client
SetVehicleNumberPlateTextSets the license plate text on a vehicle. Used by car shops, garages, and admin tools to give vehicles custom …
client
TaskWarpPedIntoVehicleInstantly places a ped into a vehicle seat (no walking animation). Common right after spawning a vehicle in ca…
client
SetPedIntoVehiclePlaces a ped into a vehicle seat. Similar to TaskWarpPedIntoVehicle but as a direct set rather than a task.
client
GetClosestVehicleFinds the closest vehicle to a set of coordinates within a radius. Used by garages, mechanics, and interaction…
client
SetEntityInvincibleToggles invincibility (god mode) for an entity. Used for admin tools, safe zones, and cutscenes.
client
SetPedComponentVariationChanges a ped's clothing/appearance component (torso, legs, etc.). The core native behind clothing and charact…
client
NetworkGetEntityFromNetworkIdConverts a network ID into a local entity handle, so a networked entity (like a spawned vehicle) can be refere…
shared
DrawMarkerDraws a 3D marker (cylinder, arrow, ring, etc.) in the world. Must be called every frame. The standard way to …
client
DoesEntityExistChecks whether an entity handle still refers to a real, existing entity. Essential before using any handle tha…
shared
IsControlJustReleasedReturns true on the single frame a control (key/button) is released. The standard way to detect a keypress for…
client
CreateThread / Citizen.CreateThreadStarts a new coroutine (thread) so code can loop and yield with Wait() without blocking the rest of the resour…
shared
AddEventHandlerAttaches a handler to an event. For LOCAL events (like onResourceStart) use it alone; for NETWORKED events you…
shared
GetCurrentResourceNameReturns the name of the resource the code is running in. Used to filter resource events and to reference your …
shared
SetVehicleModApplies a modification (spoiler, exhaust, wheels, etc.) to a vehicle. The core native behind tuner/mod menus a…
client
SetEntityHeadingSets which direction an entity faces (0-360 degrees). Used after teleporting or spawning to orient peds and ve…
client
FreezeEntityPositionFreezes or unfreezes an entity in place. Common during loading, cutscenes, or character creation to stop the p…
client
RequestAnimDictLoads an animation dictionary so you can play its animations. Pair with HasAnimDictLoaded in a wait loop befor…
client
TaskPlayAnimPlays an animation on a ped from a loaded dictionary. The core native behind emotes, job actions, and immersio…
client
ClearPedTasksStops a ped's current tasks/animations, returning them to normal control. Used to cancel emotes and scripted a…
client
IsPedInAnyVehicleReturns whether a ped is currently in any vehicle. A quick boolean check used constantly in vehicle logic.
client
GetVehicleClassReturns the class of a vehicle (compacts, SUVs, super, motorcycles, etc.) as a number. Used for class-based ru…
shared
SetVehicleEngineOnTurns a vehicle engine on or off instantly. Used for keys systems, engine toggles, and immobilizing vehicles.
client
GetDistanceBetweenCoordsReturns the distance between two 3D points. Useful, though #(vec1 - vec2) is cheaper for simple distance check…
shared
StartScreenEffectStarts a screen post-FX effect (drunk, death, focus, etc.). Used for status effects like intoxication, damage,…
client
AddBlipForCoordAdds a map blip at coordinates. The core native for marking shops, jobs, and points of interest on the map/min…
client
AddBlipForEntityAttaches a blip to a moving entity (ped/vehicle) so it tracks on the map. Used for dispatch, tracking targets,…
client
SetNotificationTextEntry / DrawNotificationShows a native GTA notification (the top-left phone-style message). A no-dependency way to notify players, tho…
client
IsEntityDeadReturns whether an entity (usually a ped) is dead. Used for death/revive systems and validity checks.
shared
SetPedArmourSets a ped's armor value (0-100 by default). Used by armor items, shops, and job loadouts.
client
GiveWeaponComponentToPedAttaches a component (suppressor, scope, extended mag, tint) to a weapon a ped holds. The native behind weapon…
client
SetBlipSpriteSets the icon (sprite) used for a blip. Determines whether a blip looks like a shop, garage, gun, etc.
client
TriggerLatentServerEventLike TriggerServerEvent but sends large data at a rate limit (bytes/sec) to avoid flooding the network. Used f…
client
SetNuiFocusGives or removes keyboard/mouse focus for a NUI (HTML UI). Essential for any interactive menu built in NUI — w…
client
SendNUIMessageSends data from Lua to your NUI (HTML/JS) as a JSON message. The main way Lua tells the UI what to show.
client
RegisterNUICallbackRegisters a Lua handler the NUI (JS) can call via fetch. The way the UI sends actions back to the game (button…
client
GetGameTimerReturns the milliseconds since the game/server started. Used for cooldowns, timing, and measuring durations.
shared
vector3 / vector4Native vector types for positions (vector3) and positions+heading (vector4). Enable cheap distance math with t…
shared
GetActivePlayers / GetPlayersReturns the list of players — GetActivePlayers on the client (nearby players), GetPlayers on the server (all c…
shared
CancelEventCancels the currently handled event where cancellation is supported (e.g. some game events, entity creation). …
shared
GetEntityModelReturns the model hash of an entity. Used to check what kind of vehicle/ped/object something is.
shared
DeleteEntityRemoves an entity from the world. Used to clean up spawned vehicles, objects, and peds. On networked entities,…
shared
SetRelationshipBetweenGroupsSets how two ped relationship groups treat each other (friendly, hate, etc.). Used to make NPC guards, gangs, …
client
TaskGoToCoordAnyMeansTells a ped to walk/drive to coordinates by any means. Used for NPC movement in missions and immersion scripts…
client
SetPedAsNoLongerNeeded / SetEntityAsNoLongerNeededTells the engine it can clean up an entity you no longer control, preventing leaks of spawned peds/vehicles/ob…
client
GetEntitySpeedReturns an entity's current speed in meters per second. Used for speedometers, speed limits, and speed-based l…
shared
SetPedPropIndexSets a ped prop (hats, glasses, ears, watches). Complements SetPedComponentVariation for accessories.
client
NetworkGetNetworkIdFromEntityConverts a local entity handle to a network ID that can be sent to the server/other clients. Pairs with Networ…
client
PlaySoundFrontendPlays a UI/frontend sound (button clicks, alerts, confirmations). Adds audio feedback to menus and interaction…
client
GetPlayerServerIdReturns the server ID for a local player index. The server ID is the stable number you use in events and serve…
client
RegisterKeyMappingBinds a command to a key the player can rebind in FiveM settings. The correct, rebindable way to add keybinds …
client