bsisko Posted May 26, 2019 Share Posted May 26, 2019 I having trouble getting the following code to work. I have this code in a function of the game.cs script in server folder. I'm trying to set the noCursor property of the playGui to 1, and it doesn't work. It needs to be in the game.cs script rather than the playgui.gui script because I need the user to select controls on the playGui gui, so that when I hide the controls the user will be able to navigate the world with the mouse. function DemoSignMin() { // Set the demosign into the loweer right hand corner DCSign.setVisible(false); DSign.setPosition(500,400); DSign.setExtent(200,100); DSign.setVisible(false); PlayGUI.noCursor = "1"; } Quote Link to comment Share on other sites More sharing options...
Duion Posted May 26, 2019 Share Posted May 26, 2019 The location of the script does not matter, it can be anywhere, you only have to worry about the execution order so that the script is available where you want it.For example I don't write any scripts in the .gui files or at least try to and instead create a playgui.cs file where I place the scripts. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted May 26, 2019 Share Posted May 26, 2019 As you say you're running this on servers and wanting clients to use it, look into the commandToClient + clientCmdand the commandToServer + serverCMD communications paradigm.The former tells the client to run something locally, and the latter tells the server to do something it's end. Quote Link to comment Share on other sites More sharing options...
bsisko Posted May 26, 2019 Author Share Posted May 26, 2019 I will give it a try Azarzel Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted November 29, 2019 Share Posted November 29, 2019 Look in core/scripts/client/cursor.csfunction showCursor(){ if ($cursorControlled) lockMouse(false); Canvas.cursorOn();}function hideCursor(){ if ($cursorControlled) lockMouse(true); Canvas.cursorOff();}hope this helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.