You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/interactv2/client/interactOptions.mdx
+24-18Lines changed: 24 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,30 @@ All interact actions are formated as an array containing objects with the follow
7
7
### Option Type Definition
8
8
9
9
```lua
10
-
---@classOption
11
-
{
12
-
label: string, -- Display label
13
-
icon?: string, -- Icon name
14
-
distance?: number, -- Max interaction distance
15
-
canInteract?: function, -- Function returning boolean
16
-
name?: string, -- Unique identifier
17
-
resource?: string, -- Owning resource
18
-
offset?: vector3, -- Relative offset
19
-
offsetAbsolute?: vector3, -- Absolute offset
20
-
bones?: string | string[], -- Bone ID(s)
21
-
onSelect?: function, -- Selection callback
22
-
cooldown?: number, -- Cooldown in milliseconds
23
-
export?: string, -- Export function name
24
-
event?: string, -- Client-side event
25
-
serverEvent?: string, -- Server-side event
26
-
command?: string-- Command to execute
27
-
}
10
+
--- Represents an interaction option with various properties.
11
+
---@classInteractOption
12
+
---@fieldlabelstring The display label for the option.
13
+
---@fieldicon? string The icon associated with the option.
14
+
---@fieldiconColor? string The css color for the icon
15
+
---@fielddistance? number The maximum distance at which the option is available.
16
+
---@fieldholdTime? number Makes the option a press and hold and sets how long it should be held for. (miliseconds)
17
+
---@fieldcanInteract? fun(entity: number, distance: number, coords: vector3, name: string): boolean? A function to determine if the option can be interacted with.
18
+
---@fieldname? string A unique identifier for the option.
19
+
---@fieldresource? string The resource that registered the option.
20
+
---@fieldoffset? vector3 A relative offset from the entity's position.
21
+
---@fieldoffsetAbsolute? vector3 An absolute offset in world coordinates.
22
+
---@fieldcolor? number[] 4 numbers in an array that will be used for rgba and will overwrite the theme color for that option.
23
+
---@fieldbones? string | string[] An array of bone IDs associated with the option.
24
+
---@fieldallowInVehicle? boolean marks the option as being able to be used inside a vehicle.
25
+
---@fieldonSelect? fun(data: InteractResponse) A function to execute when the option is selected.
26
+
---@fieldcooldown? number number of miliseconds the interact system should cooldown for after this option is selected. prevents spam.
27
+
---@fieldexport? string Optional export function name
28
+
---@fieldevent? string Client-side event to trigger
29
+
---@fieldserverEvent? string Server-side event to trigger
30
+
---@fieldcommand? string Command to execute
31
+
---@fieldonActive? fun(data: InteractResponse) A function to execute when the option is active.
32
+
---@fieldonInactive? fun(data: InteractResponse) A function to execute when the option was active and is now inactive.
33
+
---@fieldwhileActive? fun(data: InteractResponse) A function to execute while the option is active on a loop.
0 commit comments