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.
Runtime & versions
Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Luau documentation