HasModelLoaded
Docslocal retval = HasModelLoaded(model)Description
Returns whether the specified model (archetype) is currently loaded.
Note that this will return 'true' even if the model has been requested and loaded by something other than the current script, if you're intending to actually use the model in a later frame, you should call REQUEST_MODEL anyway.
Parameters
| Name | Type | Description |
|---|---|---|
model | Hash | The model hash to check for. |
Quick Snippet: Load Model Hashmodel
modelModels must be loaded before use. This snippet handles requesting and releasing properly.
-- Properly load a model before spawning/using it
local modelName = "prop_barrel_01a" -- change to your model
local modelHash = GetHashKey(modelName)
RequestModel(modelHash)
while not HasModelLoaded(modelHash) do
Wait(0)
end
print("Model loaded: " .. modelName .. " (" .. modelHash .. ")")
-- Release when done:
-- SetModelAsNoLongerNeeded(modelHash)Returns
BOOLReturns TRUE (1) or FALSE (0).