Collapse Sidebar


The games uses this function is to create the Players/LocalPlayer. Since this item is protected, attempting to use it in a Script or LocalScript will cause an error.

Although you cannot create the LocalPlayer, you can reference the LocalPlayer created by a game using the following code in a LocalScript:

	local player = game.Players.LocalPlayer


Return Type Summary

Code Samples

Creating a LocalPlayer

This example demonstrates that the Players/CreateLocalPlayer function executes without error if using the Command Bar or a Plugin and errors if executed in a LocalScript.