EntityClient1 output

getEntityScript

GET_ENTITY_SCRIPT0xA6E9C38DB51D7748

The GTA V native GET_ENTITY_SCRIPT of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityScript, in JavaScript and in Lua.

SignatureJavaScript
getEntityScript(entity: Entity): [text: string, script: ScrHandle]
SignatureLua
getEntityScript(entity: Entity): string, ScrHandle

Usage

JavaScript
const [text, script] = getEntityScript(entity);
Lua
local text, script = getEntityScript(entity)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1textstringstringstringThe native’s own return value.
2scriptScrHandlenumberintegeroutput

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns the name of the script that owns/created the entity or nullptr. Second parameter is unused, can just be a nullptr.

Reference

Namespace
Entity ENTITY
In the game
const char* GET_ENTITY_SCRIPT(Entity entity, ScrHandle* script)
Hash
0xA6E9C38DB51D7748

Open in the interactive natives reference