Skip to main content

registerSpecialProp

Shared

exports["bnl-housing"]:registerSpecialProp(options)

Parameters

  • options: table
    • model: string
    • interact?:
      • range: number
      • helpText?: string
      • keybind?:
        • padIndex: number,
        • control: number,
        • name: string,
      • target?: OxTargetOptions[]
      • marker?:
        • type: number,
        • offset: vector3,
        • size?: vector3,
        • rotation?: vector3,
        • color?:
          • r?: number,
          • g?: number,
          • b?: number,
          • a?: number
        • bob?: boolean,
        • faceCamera?: boolean
      • outline?:
        • color?:
          • r?: number,
          • g?: number,
          • b?: number,
          • a?: number
        • shader?: number
    • handlers?:
      • client?:
        • interact?: string | string[]
        • spawn?: string | string[]
        • destroy?: string | string[]
      • server?:
        • interact?: string | string[]
        • spawn?: string | string[]
        • destroy?: string | string[]

Examples

Special prop with target

exports["bnl-housing"]:registerSpecialProp({
model = 'prop_generator_01a',

interact = {
range = 2.0,

target = {
{
label = "Open generator",
icon = "fa-solid fa-eye",
onSelect = function(_, prop)
print("Interacting with", prop.id)
end
}
},

marker = {
type = 2,
offset = vector3(0.0, 0.0, 1.25),
size = vector3(0.25, 0.25, 0.25),
rotation = vector3(180.0, 0.0, 0.0),
color = {
r = 255,
g = 255,
b = 255,
a = 200
},
bob = false,
faceCamera = true
},
},

handlers = {
client = {
interact = "export.bnl-housing-utils:interact"
},
server = {
spawn = {
"event.bnl-housing-utils:spawn-generator",
"export.bnl-housing-utils:spawn-generator",
},
interact = "export.bnl-housing-utils:interact"
}
}
})

Special prop with keypress

exports["bnl-housing"]:registerSpecialProp({
model = 'prop_generator_01a',

interact = {
range = 2.0,
helpText = "~INPUT_PICKUP~ Open generator",

keybind = {
padIndex = 0,
control = 38,
name = "INPUT_PICKUP"
},

outline = {
color = {
r = 255,
g = 255,
b = 255,
a = 255
},
shader = 1
},
},

handlers = {
client = {
interact = "export.bnl-housing-utils:interact"
},
server = {
spawn = {
"event.bnl-housing-utils:spawn-generator",
"export.bnl-housing-utils:spawn-generator",
},
interact = "export.bnl-housing-utils:interact"
}
}
})