IsModelValid
Docslocal retval = IsModelValid(model)Description
Returns whether the specified model exists in the game.
Parameters
| Name | Type | Description |
|---|---|---|
model | Hash | — |
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).