
It is possible to have commands that run on the client exclusively or both.

This can be achieved by returning LocalPlayer:GetMouse().Hit.Position from the Data function, then using context:GetData() to get the Vector3.Ĭontext:GetData() will work on both client and server commands. This function will run on the client, and whatever is returned from it will be available with context:GetData() in the command implementation.Īs an example, you might want to know the local player's current mouse world position in a server command.

If you need to gather some data from the client before the command runs, you can create a Data function in your command. Take a gander at the built-in commands for more examples.
