RoyaleWindRoyaleWind

Options

Every field an interaction option takes, including rw_interact's additions for descriptions, badges, hold-to-confirm and submenus.

An option is a table. Every ox_target field works as it does there; the ones marked new are rw_interact's own and are ignored by other target resources.

{
	name = 'repair_engine',
	label = 'Fix Engine',
	description = 'Hold to repair',                 -- new
	icon = 'engine',
	iconColor = '#fb923c',
	badges = { { icon = 'tool', color = '#38bdf8' } }, -- new
	distance = 2.0,
	groups = { mechanic = 1 },
	items = 'repair_kit',
	hold = 2500,                                     -- new
	canInteract = function(entity, distance, coords, name, bone)
		return GetVehicleEngineHealth(entity) < 1000
	end,
	onSelect = function(data)
		SetVehicleEngineHealth(data.entity, 1000.0)
	end,
}

Display

FieldType
labelstringRequired.
descriptionstring?new Second line under the focused option.
iconstring?See Icons.
iconColorstring?#RRGGBB
badges{ icon, color? }[]?new Extra small icons beside the focused option.
namestring?Lets you remove the option by name.

Reach

FieldType
distancenumber?Metres from the ped. Default from /interactAdmin (2.0).
bonesstring | string[]?Vehicle/ped bone(s); each becomes its own marker at that bone.
offsetvector3?Marker position as a fraction of the model's size (0-1 per axis).
offsetAbsoluteboolean?offset is in metres from the entity instead.

Requirements

FieldType
groupsstring | string[] | table<string, number>?Job or gang, optionally with a minimum grade: { police = 2 }.
itemsstring | string[] | table<string, number>?Items needed, optionally with counts.
anyItemboolean?One of items is enough.
canInteractfun(entity, distance, coords, name, bone): boolean?Return false to hide the option. Checked again at the moment of selecting.

When groups or items fail, the option is shown greyed out with the reason ("Requires item: Lockpick") and refuses to run. Turn off Show locked options in /interactAdmin to hide them instead, as ox_target does. canInteract failing always hides it.

Actions

Use one:

Field
onSelectfun(data) called with the callback data.
eventClient event, triggered with the data.
serverEventServer event, triggered with the data (entity as a network id).
commandCommand, executed with no arguments.
export'resource.function', called with the data.
FieldType
holdnumber?new Milliseconds the player must hold to confirm; a ring fills meanwhile.

openMenu turns an option into a submenu; options with a matching menuName live inside it. Submenus nest, and right click / Backspace goes back a level.

{
	{ label = 'Repair', icon = 'tool', openMenu = 'repair' },
	{ label = 'Fix Engine', icon = 'engine', menuName = 'repair', onSelect = fixEngine },
	{ label = 'Fix Body', icon = 'car-crash', menuName = 'repair', onSelect = fixBody },
	{ label = 'Search', icon = 'search', onSelect = search },
}

Icons

Any of these work, so existing scripts keep their icons:

You writeShows
'car', 'ti ti-car'Tabler, rw_interact's own set
'fa-solid fa-car', 'fas fa-car', 'fab fa-discord'FontAwesome, as ox_target, qb-target and ox_lib use
'mdi:car', 'ph:car-bold'Any Iconify icon

A bare name is tried as Tabler first, then FontAwesome 6, then FontAwesome 5, so ox_lib-style icon = 'car' and older FontAwesome names both resolve.

On this page