RX Interact Configuration (RedM)

Everything is in config.lua.

Restart rx_interact after changing the configuration, then restart the scripts that use it.

Key and colour

Lua
Config.Color = { 255, 255, 255 }
Config.Locale = 'en'
Config.Key = 'E'
Config.Hold = 0.6
SettingDefaultBehaviour
Color{ 255, 255, 255 }Main colour of the dot, the key, and the hold ring, as r, g, b. The letter on the key switches between dark and light on its own so it stays readable.
Locale'en'en or tr. See Adding a language.
Key'E'The interact key. Players can rebind it under Settings > Key Bindings > RedM. While a prompt is up on E, the game’s own E is held back.
Hold0.6Seconds the key is held for an action. 0 makes it a simple press. Any option can override it.

Distances

Lua
Config.ShowDistance = 8.0
Config.UseDistance = 1.6
Config.Approach = 1.2
Config.ZoneDotRange = 5.0
Config.VehicleDotRange = 3.0

Config.MaxDots = 8
Config.LineOfSight = true
Config.HideInVehicle = true
SettingDefaultBehaviour
ShowDistance8.0Metres from which the dot shows up.
UseDistance1.6Metres within which the action can be used.
Approach1.2The key already shows, greyed out, this many metres before the player is in reach. 0 turns it off.
ZoneDotRange5.0How far past their own distance zones and entities show their dot.
VehicleDotRange3.0How far past its reach a wagon bone’s ring shows. Only the nearest one shows.
MaxDots8Most dots on screen at once. The nearest ones win.
LineOfSighttrueHides prompts behind walls.
HideInVehicletrueNo prompts on a horse or in a wagon or boat seat.

Look

Lua
Config.Theme = 'rdr'
Config.Scale = 0.85
Config.KeyShape = 'square'
Config.HoldStyle = 'ring'
SettingDefaultBehaviour
Theme'rdr''rdr' uses the game’s slab type, a warm white, and a red accent. 'classic' uses the FiveM look.
Scale0.85Size of the prompt, from 0.5 to 1.25.
KeyShape'square''square' (rounded corners) or 'circle'.
HoldStyle'ring''ring' fills a ring around the key; 'fill' fills the key from the bottom. Any shape works with any hold style.

The RDR theme’s typeface is Zilla Slab (SIL Open Font License), kept in html/fonts.

Bridges

Config.Bridge decides which resources RX Interact answers for. Scripts written for them keep working without changes and use the RX Interact look. Set an entry to false to keep the original resource.

Lua
Config.Bridge = {
    ['ox_target'] = true,
    ['rsg-target'] = true,
    ['murphy_interact'] = true,
    ['rsg-core DrawText'] = true,
    ['rsg-core Notify'] = true,
    ['ox_lib textUI'] = true,
    ['ox_lib context'] = true,
    ['ox_lib inputDialog'] = true,
    ['ox_lib alertDialog'] = true,
    ['ox_lib notify'] = true,
    ['qb-menu'] = false,
    ['qb-input'] = false,
}
Config.MaxDistance = 7.0
Config.OxDistance = 2.0
EntryWhat it covers
ox_targetox_target and its RedM forks (RSG’s, VORP servers’): zones, entities, models, every ped, vehicle, object, and player, groups, items, canInteract, and onSelect, export, event, serverEvent, and command.
rsg-targetIts old qb-target style exports (AddBoxZone, AddTargetModel, …) and the new v3 ox-style ones.
murphy_interactAddInteraction, AddLocalEntityInteraction, AddModelInteraction, the global interactions, and the removes.
rsg-core DrawTextDrawText, ChangeText, HideText, KeyPressed, and IsTextShown, shown as key hints.
rsg-core Notifyexports['rsg-core']:Notify, and the RSGCore:Notify event when your rsg-core has no Notify of its own.
ox_lib textUI, context, inputDialog, alertDialog, notifyText UI, context menus, input forms, confirm boxes, and notifications.
qb-menu, qb-inputOff by default. For scripts ported over from FiveM.
SettingDefaultBehaviour
MaxDistance7.0Distance for rsg-target (qb-target style) options that do not set their own.
OxDistance2.0Distance for ox_target options that do not set their own. ox_target’s 7 m is meant for aiming and is too far here.

Moving over from rsg-target

The tables from rsg-target’s config can be pasted into config.lua as they are:

Lua
Config.CircleZones = {}
Config.BoxZones = {}
Config.PolyZones = {}
Config.TargetBones = {}
Config.TargetModels = {}
Config.GlobalPedOptions = {}
Config.GlobalVehicleOptions = {}
Config.GlobalObjectOptions = {}
Config.GlobalPlayerOptions = {}
Config.Peds = {}

Key hints

Lua
Config.Hints = {
    Position = 'bottom',
    FollowPosition = false,
}
SettingDefaultBehaviour
Position'bottom'bottom, left, right, or top.
FollowPositionfalsetrue uses the position a script asks for, such as DrawText 'left' or text UI 'right-center'.

Also used for ox_lib context menus.

Lua
Config.Menu = {
    Position = 'right',
    Sounds = true,
    Volume = 0.6,
}
SettingDefaultBehaviour
Position'right'right or left.
Soundstruetrue plays RX Interact’s own soft sounds, 'game' plays the game’s menu sounds, false plays none.
Volume0.6Volume of RX Interact’s own sounds, from 0 to 1.

Forms and confirm boxes

Also used for ox_lib input and alert dialogs. Config.Dialog needs nothing set; put your own button texts in Config.Dialog.Text if you want to change them.

Notifications

Also used for ox_lib notify and rsg-core’s Notify.

Lua
Config.Notify = {
    Position = 'left',
    Top = 0.075,
    Duration = 5000,
    Max = 5,
    Sound = true,
    Types = {
        info = { icon = 'fa-solid fa-circle-info' },
        success = { icon = 'fa-solid fa-circle-check' },
        error = { icon = 'fa-solid fa-circle-exclamation', color = { 222, 82, 64 } },
        warning = { icon = 'fa-solid fa-triangle-exclamation', color = { 232, 168, 64 } },
        police = { icon = 'fa-solid fa-star', color = { 96, 150, 232 } },
        ambulance = { icon = 'fa-solid fa-kit-medical', color = { 222, 82, 64 } },
    },
}
SettingDefaultBehaviour
Position'left'left or right.
Top0.075How far down the screen the first notification sits, from 0 to 1.
Duration5000Milliseconds a notification stays when the script does not say.
Max5Most notifications on screen at once. The oldest goes first.
Soundtruetrue plays RX Interact’s own sound, 'game' plays the game’s, false plays none.
TypesIcon (a Font Awesome class) and colour for each type. police is the law, with a sheriff’s star; ambulance is the doctor. Without a colour, Config.Color is used. A script’s own icon or colour always wins.

Skill check minigame

A dot goes round the key; the player presses when it is on the lit slice. For picking a lock, skinning, breaking a horse, or anything else that wants a steady hand.

Lua
Config.Skill = {
    Rounds = 3,
    Misses = 2,
    Speed = 1.0,
    Zone = 1.0,
    Sounds = true,
    Rumble = true,
}
SettingDefaultBehaviour
Rounds3Hits needed.
Misses2Misses allowed. One more fails it.
Speed1.01 is a round in 1.6 seconds. Each hit is a little faster and turns the other way.
Zone1.0The slice’s size, 1 being about 50 degrees. Each hit makes it a little smaller.
SoundstruePlays the skill check sounds.
RumbletrueGamepad rumble on each press.

Safe minigame

Lua
Config.Safe = {
    Count = 3,
    Max = 99,
    Feel = true,
    Sounds = true,
    Camera = true,
    CameraFov = 42.0,
    Anim = false,
}
SettingDefaultBehaviour
Count3How many numbers a random code has.
Max99The dial goes from 0 to this number.
FeeltrueThe right number clicks and the gamepad rumbles, so the safe can be cracked by ear.
Soundstruetrue plays RX Interact’s own safe sounds, false plays none.
CameratrueAn over-the-shoulder camera on the dial, when the script gives the safe’s coordinates.
CameraFov42.0Field of view of that camera.
AnimfalseThe player’s animation at the dial, as { dict, idle = { clips }, right = { clips }, left = { clips } }, or false for none.

Pump minigame

A water pump, a well, or a bellows, worked a few strokes until it gives.

Lua
Config.Pull = {
    Pulls = 3,
    Sounds = true,
    Rumble = true,
    Anim = { scenario = 'PROP_HUMAN_PUMP_WATER' },
}
SettingDefaultBehaviour
Pulls3Good strokes needed.
SoundstruePlays the pump sounds.
RumbletrueGamepad rumble on each stroke.
AnimA scenario, or { dict, clip }, or false for none.

Test command

Lua
Config.TestCommand = true

Turns on /rxitest, which places every part in front of you to try in game. Set it to false on a live server.

Adding a language

English and Turkish are included.

  1. Copy locales/en.lua to locales/<code>.lua.
  2. Change Locales.en to Locales['<code>'] and translate the texts.
  3. Set Config.Locale = '<code>'.

Anything left untranslated falls back to English.