Glitched Scripts
Metal Detecting

Exports

Client and server exports for gs_metaldetect.

Check whether a player is scanning, read charge, or force-stop from another resource (radial menu, job script, cuff). Player-facing flow: Using the detector.

The resource folder must be gs_metaldetect (or gs_metaldetect-project).

Client

local scanning = exports['gs_metaldetect']:IsScanning()

local session = exports['gs_metaldetect']:GetSession()
-- nil, or { item, slot, charge, ... }

local charge = exports['gs_metaldetect']:GetCharge()
-- 0 if unequipped

local stopped = exports['gs_metaldetect']:Stop()
-- true if a session was stopped

Server

local scanning = exports['gs_metaldetect']:IsScanning(src)

local session = exports['gs_metaldetect']:GetSession(src)
-- nil, or { item, slot, charge }

local charge = exports['gs_metaldetect']:GetCharge(src)

local stopped = exports['gs_metaldetect']:Stop(src)

Server Stop clears the session and tells the client to put the detector away (reason is export).

On this page