client
RequestModel
FiveM client native documentation with a Lua example.
Summary
Requests a model to be loaded into memory before you can spawn or use it. Pair with HasModelLoaded in a wait loop.
Returns
void
Parameters
modelHashThe model hash to load.Example
local model = `adder`
RequestModel(model)
while not HasModelLoaded(model) do
Wait(0)
end
-- now safe to use the model
SetModelAsNoLongerNeeded(model)Common pitfalls
- Always wait for HasModelLoaded before using the model, or the spawn fails silently.
- Call SetModelAsNoLongerNeeded after use to free memory.
- Add a timeout to the wait loop so a bad model doesn't hang forever.
Related natives
Related guides
Need protected areas on your map?
Viper Safe-Zone draws polygon safe zones in-game — no hand-edited coordinates — with weapon, combat and vehicle-speed rules per zone.
See Viper Safe-Zone →