Skip to content

Class · inherits Script

LocalScript

Official docs ↗

An object that contains and runs Luau code on the client (player's device) instead of the server.

About LocalScript

A LocalScript is a Luau source container that runs its contents on the client (player's device) instead of the server. It is used to access client-only objects such as the player's Camera.

For code run through LocalScripts, the LocalPlayer property of the Players service will return the player whose client is running the script.

See here for a table of valid container services from which LocalScripts will execute.

LocalScript also has every member of Script. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.