HEX
HexscriptsClassicLootdrop

Exports

This section lists all client-side and server-side exports in this script. Exports can be called from other scripts to interact with this script functionality.

Note

If you need additional exports for your implementation, please open a ticket on our Discord server.

Client Exports

IsInDrop

Returns true while the player is inside a lootdrop. The export stays true for 5 seconds after the player left the lootdrop.

local isInDrop = exports['hex_lootdrop']:IsInDrop()

IsInGulag

Returns true while the player waits or fights in the gulag.

local isInGulag = exports['hex_lootdrop']:IsInGulag()

Server Exports

IsPlayerInLootdrop

Returns true while the player is inside a lootdrop. The export stays true for 5 seconds after the player left the lootdrop.

local isInLootdrop = exports['hex_lootdrop']:IsPlayerInLootdrop(playerId)

Prop

Type

GetPlayerDropId

Returns the id of the lootdrop the player is in. Returns nil if the player is in no lootdrop.

local dropId = exports['hex_lootdrop']:GetPlayerDropId(playerId)

Prop

Type

RemovePlayerFromDrop

Takes the player out of their lootdrop. Call this export before you teleport a player away, for example from an admin menu.

exports['hex_lootdrop']:RemovePlayerFromDrop(playerId)

-- remove the player and teleport them afterwards
exports['hex_lootdrop']:RemovePlayerFromDrop(source)
SetEntityCoords(GetPlayerPed(source), 215.0, -810.0, 30.7)

Prop

Type

GetDrops

Returns every running lootdrop with its players.

local drops = exports['hex_lootdrop']:GetDrops()

CreateDrop

Starts a lootdrop of the given type from Config.Types and returns the id of the new lootdrop.

local dropId = exports['hex_lootdrop']:CreateDrop(dropType)

Prop

Type

StopDrop

Stops a running lootdrop.

exports['hex_lootdrop']:StopDrop(dropId)

Prop

Type

AddObserver

Shows the zone, blips and HUD of a lootdrop to a player as a spectator.

exports['hex_lootdrop']:AddObserver(playerId, dropId)

Prop

Type

RemoveObserver

Removes the spectator view of a player again.

exports['hex_lootdrop']:RemoveObserver(playerId)

Prop

Type

Server Hooks

The hooks are located in server/functions.lua and can be edited to run your own code.

PlayerJoinedDrop

Runs when a player joined a lootdrop.

function PlayerJoinedDrop(playerId)
end

Prop

Type

PlayerLeftDrop

Runs when a player is back in the normal world.

function PlayerLeftDrop(playerId, reason)
end

Prop

Type

ReasonDescription
leftThe player left the lootdrop on their own
eliminatedThe player was eliminated
drop_endedThe lootdrop ended
job_changedThe job of the player changed
admin_teleportThe player was teleported away by an admin
disconnectedThe player disconnected