Want a special badge and 30 bux? Make some PolyWorld! Content and post it in the Creations forum!
Dark mode is incomplete! Please report any issues to the Discord.

Globals

Common globals available to Scripts and LocalScripts.
These are not classes. Documented here until they get a final home.

Events use `Event:Connect`. See Event and Connection.


Overview

Functions

Values


API

wait

wait(seconds: number?) : void deprecated
Yields the current script coroutine.
Prefer `task.wait`, which works inside event listeners too.
No longer recommended for use.

print

print(...) : void
Prints to the server log from Scripts, or the client log from LocalScripts.
Labeled with the Script name when possible. See Errors.

warn

warn(...) : void
Logs a non-fatal warning with the same Script labeling as print.

require

require(moduleScript: ModuleScript) : any
Loads a ModuleScript and returns its return value.
Results are cached per ModuleScript.

Instance.new

Instance.new(className: string) : Instance
Creates a new Instance.

classNameResult
"Part"Part
"Brick"Part deprecated alias of "Part"
"Model"Model
"Connector"Connector
"Tool"Tool
"ModuleScript"ModuleScript

On LocalScripts, only "Part" / "Brick" are supported. Those Parts have `.Client` set, are not replicated, and can be destroyed locally.
On Scripts, "Model", "Connector", "Tool", and "ModuleScript" are also supported.

local p = Instance.new("Part")
p.Name = "MyBrick"
p.Parent = workspace

workspace

workspace : Workspace
The place root.
Workspace is an alias of workspace.

Shared

Shared : table
Explicit shared environment for all Scripts in this place. Same table as bare globals written from Scripts.
LocalScripts do not use Shared.

script

script : Script or LocalScript
The currently running script.
See Script and LocalScript for Parent and events.

player

player : Player?
On LocalScripts: the local player.
On Scripts: set during Touched for legacy handlers that call player:Kill() with no argument. Prefer the player argument from the event instead.

Modules

Globals such as task, RunModule, InputModule, TweenModule, RaycastModule, PlayerMovementModule, CameraModule, PartTaggingModule, MarketplaceModule, MessageModule, StatsModule, and TeamsModule.
See Modules.