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
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
Both players go to the marriage location
One player presses E to start the marriage process
They select which surname to use (theirs or their partner's)
Both players must accept the marriage proposal
Payment is charged and item removed (if configured)
Names are updated in the database
Discord webhook notification sent (if enabled)
In-game notification shown to all players
Divorce Process
Both married players go to the divorce location
One player presses E to start divorce
Both players must accept the divorce
Payment is charged (from the player who initiated)
Names are restored to original
Marriage record deleted from database
Discord webhook notification sent (if enabled)
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?
Check this documentation first
Verify all config options are correct
Check server console for error messages
Test with default config values
Need customization?
All player-facing features are configurable through config.lua, webhook_config.lua, and html/css/config.css
Config.Functions = {
notify = function(ntype, title, text, time)
-- Replace with your notification export
exports["your-notify"]:ShowNotification(text, ntype)
end,
helpnotify = function(key, text)
-- Replace with your help text system
exports["your-notify"]:ShowHelp(text)
end,
}
Config.Strings = {
-- Interaction prompts
press_to_marry = "Press E to marry",
press_to_divorce = "Press E to start divorce",
none_nearby = "No one nearby",
busy_priest = "Someone is already talking to the priest.",
-- UI text
cost_select_hint = "Select the surname you will both carry",
cost_selected_tpl = "%s will be your shared surname",
ui_marry_title = "Do you want to get married?",
ui_accept_marry_title = "Do you accept the marriage?",
ui_divorce_title = "Do you want a divorce?",
ui_costs_title = "MARRIAGE COSTS",
ui_divorce_costs_title = "DIVORCE COSTS",
ui_accept = "ACCEPT",
ui_cancel = "CANCEL",
ui_info_will_be_tpl = "If you accept, your name will be %s",
-- Notifications
notify_title = "BIG NEWS",
notification_title = "Marriage",
notify_couple_tpl = "%s and %s just got married!",
notify_family_tpl = "From now on they are known as the %s family",
notify_divorce_title = "BREAKING",
notify_divorce_tpl = "%s and %s got divorced.",
-- Status messages
already_married = "You are already married.",
not_married = "You are not married.",
partner_not_nearby = "Your partner is not nearby",
not_enough_money = "Not enough money",
missing_item = "Required item missing",
partner_missing_item = "%s doesn't have %s",
item_required = "You don't have the required item %s",
-- Action responses
has_accepted = "has accepted",
has_declined = "has declined the marriage",
has_accepted_divorce = "has accepted the divorce",
has_declined_divorce = "has declined the divorce",
}
WebhookConfig.Marriage = {
Enabled = true,
WebhookURL = "https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE",
Username = "π Wedding Chapel",
AvatarURL = "https://files.catbox.moe/qfwy1k.png",
Color = 15844367,
AuthorIconURL = "https://files.catbox.moe/qfwy1k.png",
ThumbnailURL = "https://files.catbox.moe/c89s4v.webp",
BannerURL = "https://files.catbox.moe/8am1my.avif",
FooterIconURL = "https://files.catbox.moe/c89s4v.webp",
Locale = {
author_name = "π Marriage Announcement",
family_text = "FAMILY",
description = "Two hearts have become one!",
partner1_label = "π° Partner 1",
partner2_label = "π€΅ Partner 2",
new_family_label = "π New Family Name",
date_label = "π Marriage Date",
footer_text = "β€οΈ May your love last forever β€οΈ"
}
}
WebhookConfig.Divorce = {
Enabled = true,
WebhookURL = "https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE",
Username = "π Court House",
AvatarURL = "https://files.catbox.moe/qfwy1k.png",
Color = 15158332,
AuthorIconURL = "https://files.catbox.moe/qfwy1k.png",
ThumbnailURL = "https://files.catbox.moe/3twuw7.png",
BannerURL = "https://files.catbox.moe/2mkmqr.png",
FooterIconURL = "https://files.catbox.moe/qfwy1k.png",
Locale = {
author_name = "π Divorce Announcement",
title = "π **DIVORCE**",
description = "A marriage has ended",
partner1_label = "π€ Former Partner 1",
partner2_label = "π€ Former Partner 2",
date_label = "π Divorce Date",
footer_text = "π Sometimes love fades away..."
}
}