Syntax
print(script.ClassName, script:GetFullName())Examples
Identify a server entry point
Create a Script in ServerScriptService. Keep its default Legacy run context, or explicitly select Server. Press Play and inspect Output to see that it runs on the server.
local RunService = game:GetService("RunService")
print("Server:", RunService:IsServer())
print(script:GetFullName())Identify a client entry point
Create a LocalScript in StarterPlayer > StarterPlayerScripts. During Play, Roblox copies it into that player’s PlayerScripts. LocalPlayer exists on this client, not in the server example.
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
print("Client:", RunService:IsClient())
print(Players.LocalPlayer.Name)
print(script:GetFullName())Best practices
- When debugging, check script type, location, Enabled and RunContext before rewriting the code.
- A ModuleScript in ReplicatedStorage is shared source, not shared mutable client/server memory.
- A LocalScript placed directly in ReplicatedStorage does not run; use a supported client location or deliberately configured client Script.
At a glance
- Purpose
- Typed scripting and Roblox development
- File extension
- .luau
- Runs in
- Luau host; Roblox engine examples require Roblox Studio
- Usually used with
- Roblox APIs and Studio
Specifications & further reading
Related Luau documentation
Client/server boundaries and project structure
A server owns shared game decisions while each client handles its own input, camera and presentation. Treat client messages as requests. Put private rules in server containers and expose only the data and operations the client actually needs.ModuleScripts and exported types
A ModuleScript returns a value for require to use. Keep reusable calculations in modules and choose storage based on who may require them. Requiring the same module on the client and server does not create shared memory between those environments.game, workspace and storage services
game is the root DataModel and workspace holds the active 3D world. GetService obtains engine services by class name. ReplicatedStorage is visible to both sides; ServerStorage holds objects clients should not receive until the server places them into a replicated location.Instances, properties and methods
Instances form the Roblox object tree. Properties describe an object, methods perform operations, and events report changes. Check the class before using class-specific properties; a child with the right name can still be the wrong kind of object.
A server owns shared game decisions while each client handles its own input, camera and presentation. Treat client messages as requests. Put private rules in server containers and expose only the data and operations the client actually needs.ModuleScripts and exported types
A ModuleScript returns a value for require to use. Keep reusable calculations in modules and choose storage based on who may require them. Requiring the same module on the client and server does not create shared memory between those environments.game, workspace and storage services
game is the root DataModel and workspace holds the active 3D world. GetService obtains engine services by class name. ReplicatedStorage is visible to both sides; ServerStorage holds objects clients should not receive until the server places them into a replicated location.Instances, properties and methods
Instances form the Roblox object tree. Properties describe an object, methods perform operations, and events report changes. Check the class before using class-specific properties; a child with the right name can still be the wrong kind of object.