πŸ’MARRIAGE

Note: This documentation focuses on configuration options available to server owners. The script handles framework detection automatically and supports ESX, QBCore, and QBox.


1) Overview

Risk Marriage Script allows players to get married and divorced in your FiveM server. The script includes:

  • πŸ’’ Marriage system with customizable locations and costs

  • πŸ’” Divorce system with separate locations

  • πŸ’ Optional item requirements (wedding rings)

  • πŸ”” Discord webhook notifications

  • πŸ—ΊοΈ Configurable blips, NPCs, and markers

  • 🌐 Full localization support

  • 🎨 Custom UI with themes


2) Basic Configuration

Framework Detection

RISK.Framework = "auto"

Options: "auto", "esx", "qb", "qbox" Recommended: Leave as "auto" for automatic detection

Interaction Range

Distance in meters players must be within to interact with NPCs/markers


3) Marriage Configuration

Location & Cost

  • Location: Marriage NPC/marker coordinates (x, y, z, heading)

  • MarriageCost: Price to get married

  • MarriageAccount: Payment method ('cash' or 'bank')

Item Requirements

Item Configuration:

  • CheckItem: Enable/disable item requirement

  • MarriageItem: Item name (must match your items database)

  • MarriageItemLabel: Display name shown in notifications

  • ItemAmount: Quantity required

  • BothPlayersNeedItem: If true, both partners need the item

  • RemoveItemAfter: Remove item(s) after successful marriage


4) Visual Configuration

Marriage Blip

Blip Sprites Referencearrow-up-right

Marriage NPC

  • Model: Ped model (e.g., "cs_priest", "a_m_y_business_01")

  • Scenario: Animation (Scenario Listarrow-up-right)

  • Freeze: Prevent NPC from walking

Marriage Marker

Note: Typically use either NPC or marker, not both Marker Types Referencearrow-up-right


5) Divorce Configuration

Location & Cost

Divorce Blip

Divorce NPC

Divorce Marker


6) Notification System

Custom Notifications

To use default notifications:

To integrate other notification systems:


7) Localization / Strings

All UI text can be customized in Config.Strings:

Translation tip: Use %s as placeholder for dynamic values (names, items, etc.)


8) Discord Webhooks

Marriage Webhook

Divorce Webhook

Discord Embed Colors:


9) UI Theming

Customize UI colors in html/css/config.css:

Color themes examples:


10) Complete Configuration Examples

Example 1: Free Marriage, No Items

Example 2: Expensive Marriage with Item Requirement

Example 3: Church Wedding (Custom Location)

Example 4: City Hall (Minimal Setup)


11) How It Works

Marriage Process

  1. Both players go to the marriage location

  2. One player presses E to start the marriage process

  3. They select which surname to use (theirs or their partner's)

  4. Both players must accept the marriage proposal

  5. Payment is charged and item removed (if configured)

  6. Names are updated in the database

  7. Discord webhook notification sent (if enabled)

  8. In-game notification shown to all players

Divorce Process

  1. Both married players go to the divorce location

  2. One player presses E to start divorce

  3. Both players must accept the divorce

  4. Payment is charged (from the player who initiated)

  5. Names are restored to original

  6. Marriage record deleted from database

  7. Discord webhook notification sent (if enabled)

  8. In-game notification shown to all players

Name System

  • Marriage: Players adopt the chosen surname

  • Divorce: Players' names are restored to their original first and last names

  • Names are automatically synced with ESX/QBCore/QBox databases


12) Database

The script automatically creates this table:

No manual setup required β€” the script handles everything automatically.


13) Troubleshooting

❌ "Someone is already talking to the priest"

Cause: Another player is currently in the marriage flow Solution: Wait for the other player to finish or cancel

❌ "No one nearby"

Possible causes:

  • Partner is too far away (must be within 5 meters)

  • Only one player at the location

  • Player is already married (check database)

Solution: Both players stand close together at the location

❌ "You don't have the required item"

Cause: Config.CheckItem = true but player lacks the item Solution:

  • Give the item: /giveitem [id] wedding_ring 1

  • Or disable: Config.CheckItem = false

❌ "Not enough money"

Cause: Player doesn't have sufficient cash/bank balance Solution:

  • Lower Config.MarriageCost or Config.DivorceCost

  • Give money to the player

  • Change Config.MarriageAccount from 'bank' to 'cash' (or vice versa)

❌ Marriage UI won't open

Possible causes:

  • Too far from location (must be within Config.InteractionRange)

  • NPC not spawned correctly

  • Already married

Solution:

  • Check server console for errors

  • Verify coordinates in config

  • Restart the resource: /restart risk-marry

❌ Names not updating after marriage/divorce

Possible causes:

  • Database connection issue

  • Framework detection failed

  • Character data cache

Solution:

  • Verify framework is detected: Check RISK.Framework in config

  • Restart framework resource

  • Have players relog

❌ Discord webhook not working

Possible causes:

  • Invalid webhook URL

  • Webhook deleted from Discord

  • Enabled = false

Solution:

  • Create new webhook in Discord channel settings

  • Copy full webhook URL including /12345/token

  • Set WebhookConfig.Marriage.Enabled = true

❌ Custom notification not showing

Cause: Notification resource not started or incorrect export name Solution:

This will use default FiveM notifications


14) Best Practices

βœ… Test with two accounts before going live βœ… Use bank account for larger costs (Config.MarriageAccount = 'bank') βœ… Set reasonable prices based on your economy (suggested: $5k-$25k) βœ… Position NPCs away from traffic to avoid accidental interruptions βœ… Use unique blip sprites to differentiate marriage/divorce locations βœ… Customize strings to match your server's language/theme βœ… Test webhooks in a private Discord channel first βœ… Backup your database before making changes


15) Support & Updates

Having issues?

  1. Check this documentation first

  2. Verify all config options are correct

  3. Check server console for error messages

  4. Test with default config values

Need customization? All player-facing features are configurable through config.lua, webhook_config.lua, and html/css/config.css


Last updated