RegisterObjectScriptBrain
DocsRegisterObjectScriptBrain(scriptName, modelHash, p2, activationRange, p4, p5)Description
Registers a script for any object with a specific model hash.
BRAIN::REGISTER_OBJECT_SCRIPT_BRAIN("ob_telescope", ${prop_telescope_01}, 100, 4.0, -1, 9);Parameters
| Name | Type | Description |
|---|---|---|
scriptName | char* | — |
modelHash | Hash | — |
p2 | int | — |
activationRange | float | — |
p4 | int | — |
p5 | int | — |
Quick Snippet: Load Model HashmodelHash
modelHashModels 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
voidThis native does not return a value.