Globals - tayjay/SCriPt GitHub Wiki

The following are global variables that can be accessed from anywhere in the code.

AdminToys

For spawning and interacting with Admin Toys. These are Unity primitive or custom objects that can be spawned in the game such as cubes, spheres, lights, speakers, and NPC toys.

Type Function Arguments
TextToy AdminToys:SpawnText Vector3 position
Quaternion rotation
string text
LightSourceToy AdminToys:SpawnLightSource Vector3 position
float intensity
Color? color
float range
ShootingTargetToy AdminToys:SpawnShootingTarget Vector3 position
Quaternion rotation
Vector3 scale
SpeakerToy AdminToys:SpawnSpeaker Vector3 position
Quaternion rotation
Vector3 scale
CapybaraToy AdminToys:SpawnCapybara Vector3 position
Quaternion rotation
Vector3 scale
bool collidable
PrimitiveObjectToy AdminToys:SpawnPrimitiveObject PrimitiveType type
Vector3 position
Quaternion rotation
Vector3 scale
Color color
bool collidable

Coroutines

For managing delayed and repeated code execution inside scripts.

Type Function Arguments
CoroutineHandle Coroutines:CallDelayed float delay
Closure closure
CoroutineHandle Coroutines:CallDelayed float delay
Closure closure
object[] args
CoroutineHandle Coroutines:CallCoroutine Closure closure
CoroutineHandle Coroutines:CallCoroutine Closure closure
object[] args
CoroutineHandle Coroutines:RunCoroutine Closure closure
CoroutineHandle Coroutines:RunCoroutine Closure closure
object[] args
CoroutineHandle Coroutines:CallContinuously float timeframe
Closure closure
CoroutineHandle Coroutines:CallContinuously float timeframe
Closure closure
object[] args
CoroutineHandle Coroutines:CallPeriodically float timeframe
float period
Closure closure
CoroutineHandle Coroutines:CallPeriodically float timeframe
float period
Closure closure
object[] args
void Coroutines:Kill CoroutineHandle handle
void Coroutines:KillCoroutine CoroutineHandle handle
void Coroutines:KillAll
float Coroutines:WaitForSeconds float seconds

Data

For storing and retrieving persistent custom script data.

Type Function Arguments
LuaCustomData Data:Get string name

DeadmanSwitch

For controlling the warhead deadman switch system.

Type Function Arguments
void DeadmanSwitch:Initiate float addDelay
void DeadmanSwitch:Disable
void DeadmanSwitch:Enable

Decon

For controlling LCZ decontamination.

Type Function Arguments
void Decon:Disable
void Decon:Force
void Decon:Reset

Dummy

For spawning and controlling dummy players for testing and events.

Type Function Arguments
Player Dummy:Spawn string name
Player Dummy:Remove Player dummy
Table Dummy:GetDummyActions Player dummy
float Dummy:Action Player dummy
string action
void Dummy:ActionSequence Player dummy
Table sequence

Events

For accessing all scriptable event handlers.

Type Variable Interaction
LuaServerEvents Events.Server Get
LuaPlayerEvents Events.Player Get
LuaWarheadEvents Events.Warhead Get
LuaScp049Events Events.Scp049 / Events.Doctor Get
LuaScp096Events Events.Scp096 / Events.ShyGuy Get
LuaScp173Events Events.Scp173 / Events.Peanut Get
LuaScp106Events Events.Scp106 / Events.Larry Get
LuaScp939Events Events.Scp939 / Events.Dog Get
LuaScp0492Events Events.Scp0492 / Events.Zombie Get
LuaScp914Events Events.Scp914 Get
LuaObjectiveEvents Events.Objective Get
LuaScp079Events Events.Scp079 Get
LuaScp127Events Events.Scp127 Get
LuaScp3114Events Events.Scp3114 / Events.Skeleton Get

Lobby

For controlling the pre-game lobby.

Type Function Arguments
void Lobby:Lock
void Lobby:Unlock

New

For creating new Unity value types from Lua.

Type Variable Interaction
Func New:Vector3 Static
Func New:Vector2 Static
Func New:Quaternion Static
Func New:Color Static

Players

For retrieving and interacting with players.

Type Function Arguments
Player Player:ByName string name
Player Player:ByUserId string id
Player Player:ById int id
Player Player:ByNetId int netId
Player Player:ByReferenceHub ReferenceHub hub
IReadOnlyCollection Player:ByRole RoleTypeId role
IReadOnlyCollection Player:ByTeam Team team
IReadOnlyCollection Player:ByZone FacilityZone zone
Player Player:Random
IReadOnlyCollection Player:All

Round

For controlling and monitoring the game round.

Type Function Arguments
void Round:Lock
void Round:Unlock
void Round:Start
void Round:Restart
void Round:End

SCriPt

For creating modules, commands, and registering types in SCriPt.

Type Function Arguments
LuaModule SCriPt:Module string name
LuaModule SCriPt:Mod string name
LuaCustomCommand SCriPt:Command CommandType type
string name
string[] aliases
string description
string permission
Closure execute
LuaCustomSettings SCriPt:Settings Table settings
Closure callback
void SCriPt:RegisterType string typeName

Server

For retrieving server info and sending remote/local admin commands.

Type Variable Interaction
int Server.Port Get
string Server.Name Get
string Server.IpAddress Get
int Server.PlayerCount Get
int Server.MaxPlayers Get
bool Server.IdleModeAvailable Get/Set
bool Server.IdleModeActive Get
bool Server.FriendlyFire Get/Set
List Server.RemoteAdmins Get
Type Function Arguments
string Server:RACommand string command
string Server:RACommandAs string command
Player player
string Server:LACommand string command
void Server:SendBroadcast string message
ushort duration
void Server:Restart
void Server:Shutdown

Settings

For creating Server Specific Settings.

Type Function Arguments
SSButton Settings:Button string name,
string buttonText,
string hint = nil
SSGroupHeader Settings:GroupHeader string label,
string hint = nil
SSTextArea Settings:TextArea string content
SSDropdownSetting Settings:Dropdown string label,
string[] options,
int selectedIndex,
string hint = nil
SSKeybindSetting Settings:Keybind string label,
KeyCode defaultKey = KeyCode.None,
string hint = nil
SSPlaintextSetting Settings:Plaintext string label,
string content,
string hint = nil,
ContentType contentType = ContentType.Standard
SSSliderSetting Settings:Slider string label,
float minValue,
float maxValue,
float defaultValue,
string hint = nil
SSTwoButtonsSetting Settings:TwoButtons string label,
string buttonAText,
string buttonBText,
defaultIsB = false,
string hint = nil
ServerSpecificSettingBase Settings:GetSettingOfPlayer Player player,
int id

Time

For retrieving server and round time.

Type Variable Interaction
long Time.ServerTimeUtc Get
long Time.ServerTimeLocal Get
double Time.RoundDuration Get
DateTime Time.ServerDateTimeUtc Get
DateTime Time.ServerDateTimeLocal Get
TimeSpan Time.RoundTimeSpan Get
Type Function Arguments
TimeSpan Time:MillisecondsToTimeSpan long milliseconds
TimeSpan Time:SecondsToTimeSpan double seconds

Warhead

Interacting with the Alpha Warhead system, which is the nuclear warhead in the game.

Type Variable Interaction
double Warhead.CooldownTime Get/Set
float Warhead.DetonationTime Get/Set
bool Warhead.LeverStatus Get/Set
Type Function Arguments
void Warhead:Lock
void Warhead:Unlock
void Warhead:Start
void Warhead:Stop
void Warhead:Shake
⚠️ **GitHub.com Fallback** ⚠️