Client
This page documents all available client-side exports for SD-Horde. These exports allow you to interact with the horde system from other client-side scripts.
Game State
IsPlayerInHorde
Check if the local player is currently in a horde game.
local inGame, gameState = exports['sd-horde']:IsPlayerInHorde()Returns
inGame
boolean
Whether the player is in a horde game
gameState
string
Current game state
Game States
none
Not in a game
starting
Game is initializing
active
Combat phase - fighting enemies
looting
Looting phase between rounds
perk_voting
Players are voting on perks
ending
Game is ending
completed
Game has been completed
Example
GetCurrentRound
Get the current round number in the active horde game.
Returns
round
number|nil
Current round number, or nil if not in game
Example
GetCurrentMap
Get the current map name being played.
Returns
mapName
string|nil
Map identifier, or nil if not in game
Example
HasPendingGame
Check if the local player has a pending game (heading to entry location).
Returns
hasPending
boolean
Whether the player has a pending game
isHost
boolean
Whether the player is the host of the pending game
Example
Player State
IsPlayerDead
Check if the local player is dead/downed in the current horde game. Uses comprehensive detection including medical system state bags.
Returns
isDead
boolean
Whether the player is dead or downed
reason
string|nil
Detection source (for debugging)
Detection Reasons
native_dead
GTA native IsEntityDead check
native_dying
GTA native IsPedDeadOrDying check
state_dead
Player state bag indicates dead
already_notified
Death already processed by horde system
revive_grace_period
Player was recently revived
Example
IsCarryingLoot
Check if the local player is currently carrying loot.
Returns
isCarrying
boolean
Whether the player is carrying loot
lootValue
number
Value of carried loot (0 if not carrying)
Example
GetPlayerLevel
Get the local player's horde level, XP, and statistics.
Returns
levelInfo
table|nil
Level information, or nil if unavailable
Level Info Object
level
number
Current horde level
xp
number
Current XP amount
stats
table
Player statistics (kills, deaths, rounds, etc.)
Example
UI Controls
OpenHordeMenu
Open the horde menu programmatically. Useful for custom NPCs or interaction systems.
Returns
success
boolean
Whether the menu was opened (false if already in game)
Example
CloseAllUI
Close all open horde UI elements (shop, perk selection, end game loot, HUD).
Returns
success
boolean
Always returns true
Example
Perks System
These exports allow you to interact with the perk system during horde games.
ApplyPerk
Apply a perk to the local player.
Parameters
perkId
string
The perk identifier to apply
RemovePerk
Remove a specific perk from the local player.
Parameters
perkId
string
The perk identifier to remove
ClearAllPerks
Remove all active perks from the local player.
IsPerkActive
Check if a specific perk is currently active.
Parameters
perkId
string
The perk identifier to check
Returns
isActive
boolean
Whether the perk is active
GetActivePerks
Get a table of all currently active perks.
Returns
activePerks
table
Table of active perk IDs (key = perkId, value = true)
Example
GetActivePerksForHUD
Get active perks formatted for HUD display.
Returns
perksForHUD
table
Array of perk data formatted for UI display
GetPerkModifiers
Get all current perk modifiers affecting the player.
Returns
modifiers
table
Table of all active modifiers
Perk Modifier Exports
These exports return specific modifier values based on active perks.
Damage Modifiers
Weapon Modifiers
Economy Modifiers
Enemy Modifiers
These affect how enemies behave (typically from debuff perks):
Perk Event Hooks
OnEnemyKilled
Trigger perk effects when an enemy is killed.
Parameters
enemyPed
number
The enemy ped entity
wasHeadshot
boolean
Whether the kill was a headshot
OnPlayerDamaged
Trigger perk effects when the player takes damage.
Parameters
damageAmount
number
Amount of damage taken
Mystery Box
SpawnMysteryBox
Spawn the mystery box for a specific map.
Parameters
mapName
string
The map identifier
RemoveMysteryBox
Remove the currently spawned mystery box.
UseMysteryBox
Use the mystery box (initiate the spin animation and reward).
Last updated