I’ve replaced the code sample on the page. The new code sample shows how a server Script can toggle a player’s ability to use mouse lock. It does this via a chat command “mouselock”.
This change should be visible soon. Hope this is more useful than the existing sample!
I’m pretty sure that using the PlayerModule you can already toggle mouse lock mode. Unfortunately, the PlayerModule isn’t documented like the Lua Chat System is.
Update, this is possible but due to a fast flag (“UserRemoveTheCameraApi”) you can’t with the stock PlayerModule. You would have to edit the CameraModule script to remove this restriction.