ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
shared

GetEntityModel

FiveM shared native documentation with a Lua example.

Summary

Returns the model hash of an entity. Used to check what kind of vehicle/ped/object something is.

Returns

Hash — the model hash.

Parameters

entitynumberThe entity handle.

Example

local model = GetEntityModel(veh)
if model == `police` then
  -- it's a police cruiser
end

Common pitfalls

  • Compare against backtick-hashed literals (police) for readability.
  • Works on any entity type.

Related natives

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →