Skip to content

Scripting API

local RadioAPI = require(game.ServerStorage.RadioSystem.RadioAPI)
-- or, from anywhere:
ServerStorage.RadioSystem.API:Invoke("Method", ...)

target means an alias ("Security 3"), a radio ID, a player name or a Player.

Alerts

Call Notes
Alert(spec) → id Text (required); Channel, Key, Channels or AllCall; PAOnly; Priority (Low / Normal / High / Critical); Tone; Repeat 1–5; Source
CancelAlert(id) · AlertStatus(id) · AlertQueue()

Radios

Call Notes
Units() Every radio and its state
GetRadio(target) One radio
Channels() · SetChannel(target, channel)
SetPower(target, on)
Emergency(target, on) · ClearEmergency(target)
GiveRadio(player) · TakeRadio(player)
Checkout(player, dock?) · Return(player, dock?) · Docks()
KillRadio(target) · ReviveRadio(target) · KilledRadios() Permanent disable, saved across servers. target may be the UserId of an offline player
AssignTalkgroup(targets, channel) · RemoveTalkgroup(targets) Dynamic regrouping. targets may be "All"
Traffic(limit) · PASpeakers()

Job tickets

Call Notes
JobTicket({ To, Title, Text, Priority, From }) → id To is a role, alias, radio ID, Player or "All"
UpdateJobTicket(id, { State, Title, Text, Priority, Cancelled, By }) State is New, Started or Completed
JobTickets() Every ticket and its state

Telephony

Call Notes
RegisterPhoneGateway(fn) fn(number, caller) returns { Name, Source, Sink, OnEnd, OnDigits }
PhoneCallRadio(target, { Name, Source, Sink, OnEnd }) · EndPhoneCall(target)
GetChannelEndpoints(channel) → { Key, Input, Output } Wire a PBX straight into a channel
OpenPatch(channel, { Name, Source, Sink, Priority, OnPreempt }) → id · ClosePatch(id)

Portal and events

Call Notes
PortalStatus() · PortalSync()
On(event, fn) Subscribe to an event (below)
RadioAPI.On("Emergency", function(unit)
    print(unit.alias, "emergency at", unit.location)
end)

Events: TxBegin · TxEnd · TxDenied · Preempted · Emergency · ManDown · LoneWorkerAlarm · AlertStarted · AlertFinished · CheckedOut · Returned · Stunned · CaptionSent · TrafficLogged · TalkgroupAssigned · TalkgroupRemoved · RadioKilled · RadioRevived · ToolBound · PortalSynced