removeGlobalModelById
Removes global interactions associated with a specific model or an array of models and an id.
Parameters
id
(number | string
): The unique identifier of the interaction you wish to remove. This ID is returned by the function used to add the interaction initially.
Example
local interactionId = interact.addGlobalModel({
id = 'TakeNozzle',
models = {
`prop_gas_pump_1a`
`prop_gas_pump_1b`
},
options = {
{
label = "Take Nozzle",
icon = "hand", -- Example simple FA icon name
canInteract = function(entity, distance, coords, id)
return true
end
onSelect =function(data)
print("Global model action triggered")
end,
},
},
renderDistance = 5.0,
activeDistance = 2.0,
cooldown = 1500
})
interact.removeGlobalModel(interactionId)
export
exports.sleepless_interact:removeGlobalModel(interactionId)