[[server]]
Function exists on the server only.
Syntax
Section titled “Syntax”[[server]]void SaveData(Player player) { }Parameters
Section titled “Parameters”None.
Return value
Section titled “Return value”Per function.
Luau emit
Section titled “Luau emit”omitted on client files; RunService:IsServer() wrapper in modules
Description
Section titled “Description”On a .client.clpp, the function is omitted. On a .server.clpp, it emits normally. In a module, emit wraps RunService:IsServer().
Example
Section titled “Example”[[server]]void SaveData(Player player) {}Emits:
-- emitted only when the file is a server Script / IsServer()