DirkScripts
Docs
ποΈ Target
#AddBoxZone
{% code fullWidth="false" %}
luaCore.Target.AddBoxZone("myBoxZone", { Position = vector4(0,0,0,0), Distance = 1.5, Height = 2.0, Width = 2.0, Length = 1.0, Options = { { canInteract = function(entity,distance,data) --## return false if you dont want to be able to see this option return true end, action = function(entity) --## Run my code here on interact with this option end, icon = 'fa-solid fa-burger', label = "My Option Label", }, }, })
{% endcode %}
#DeleteZone
luaCore.Target.DeleteZone("zoneName") --## Will remove this target zone
#AddEntity
lua--## Entity can be a network entity id or just a regular id Core.Target.AddEntity(entity, { Distance = 1.0, Local = false, --## Set to true if this is a network entity/ID Options = { { canInteract = function(entity,distance,data) --## return false if you dont want to be able to see this option return true end, action = function(entity) --## Run my code here on interact with this option end, icon = 'fa-solid fa-burger', label = "My Option Label", }, }, })
#RemoveEntity
luaCore.Target.RemoveEntity(entity,isNetworkEntity) --## Will remove target options from this entity
#AddGlobalVehicle
Core.Target.AddGlobalVehicle({
Distance = 1.5,
Options = {
{
canInteract = function(entity, distance, data,name, bone)
return true
end,
action = function(...)
local argR = {...}
local arg = argR[1]
--## arg.entity etc is accessible like this
end,
icon = "fas fa-box-open",
label = "Place Object",
}
},
})
#AddGlobalPed
luaCore.Target.AddGlobalPed({ Distance = 1.5, Options = { { canInteract = function(entity, distance, data,name, bone) return true end, action = function(...) local argR = {...} local arg = argR[1] --## arg.entity etc is accessible like this end, icon = "fas fa-box-open", label = "Place Object", } }, })
