API & EXPORTS GUIDE

This documentation covers all exports and API functions available for developers integrating Risk HUD V2 into their scripts.

๐ŸŽฏ Available Exports

1) Notify โ€” Display Notifications

Display customizable notifications to players.

exports['risk-hudv2']:Notify(data)

Parameters:

  • data (table) โ€” Notification configuration

Data Structure:

{
    type = 'success',      -- 'success', 'error', 'info', 'warning'
    title = 'Title',       -- Notification title
    message = 'Message',   -- Notification content
    duration = 8000        -- Duration in milliseconds (default: 8000)
}

Examples:

Success notification:

exports['risk-hudv2']:Notify({
    type = 'success',
    title = 'Vehicle Parked',
    message = 'Your vehicle has been successfully stored in the garage.',
    duration = 5000
})

Error notification:

Info notification:

Warning notification:

Alternative: Event-based (from server):

Legacy format (also supported):


2) HelpNotify โ€” Display Help Prompts

Show interactive help text (e.g., "Press E to open door").

Parameters:

  • key (string) โ€” Key to display (e.g., "E", "F", "SPACE")

  • message (string) โ€” Help text to show

Auto-closes after 1 second of no calls โ€” Perfect for loops!

Examples:

Basic door interaction:

Vehicle interaction:

Item pickup:

Multiple actions:


3) startProgress โ€” Progress Bar

Display an animated progress bar with optional player freeze, animation, and props.

Parameters:

  • duration (number) โ€” Duration in milliseconds

  • label (string) โ€” Text shown on progress bar

  • options (table) โ€” Configuration options

Options Structure:

Progress can be cancelled by:

  • Pressing BACKSPACE (key 202)

  • Pressing X (key 73)

  • Calling cancelProgress() export

Examples:

Vehicle repair:

Lockpicking:

Gathering resources:

Simple progress (no animation):

Crafting with prop:


4) cancelProgress โ€” Cancel Progress Bar

Manually cancel an active progress bar.

Examples:

Cancel on player damage:

Cancel from server:

Cancel on player movement:


๐Ÿ“ข Announcements System

Server Export: SendAnnouncement

Send server-wide announcements to all players.

Parameters:

  • duration (number) โ€” Duration in milliseconds

  • message (string) โ€” Announcement text

  • name (string) โ€” Sender name (optional, uses config default)

  • title (string) โ€” Announcement title (optional, uses config default)

Examples:

Simple announcement:

Custom sender and title:

Restart warning:


Client Command: /announcement

Usage:

Examples:


Server Event: Announcement

From client to server:

Example:


Targeted Announcement (Single Player)

Command:

Server Event:

Example:


๐ŸŽจ Complete Integration Examples

Example 1: Vehicle Shop System

Example 2: Robbery System

Example 3: Crafting System

Example 4: Drug Processing

Last updated