heizung124 0 Posted November 12, 2018 How could i do something on Keyboard key pressed ? Share this post Link to post Share on other sites
SmashT 10907 Posted November 13, 2018 The key pressing and corresponding actions/update on server are done via rpc from what I've read. Corey on Discord shared the following as a quick example how can you send an RPC on key press, way over my head but maybe helpful for you. This goes into your missionGameplay onKeypress if ( key == KeyCode.KC_O ) { ScriptRPC rpc = new ScriptRPC(); rpc.Write("string"); rpc.Write(1); rpc.Write(12.5); rpc.Send(null, M_RPCs.M_TEST, true); } so if you press O, it will forge the RPC, fill with desired data then send it to the server 1 Share this post Link to post Share on other sites
heizung124 0 Posted November 13, 2018 (edited) 1 hour ago, smasht said: The key pressing and corresponding actions/update on server are done via rpc from what I've read. Corey on Discord shared the following as a quick example how can you send an RPC on key press, way over my head but maybe helpful for you. This goes into your missionGameplay onKeypress if ( key == KeyCode.KC_O ) { ScriptRPC rpc = new ScriptRPC(); rpc.Write("string"); rpc.Write(1); rpc.Write(12.5); rpc.Send(null, M_RPCs.M_TEST, true); } so if you press O, it will forge the RPC, fill with desired data then send it to the server Nice exactly what i was looking for thanks Edit but does not work override void OnKeyPress( int key ) { Print("key releae" + key) // does not print super.OnKeyRelease( key ); if ( key == KeyCode.KC_T ) { Print("key press" + key + "t") // surly does not print GetPlayer().MessageStatus( "Key pressed" ); //same } } Any Idea? Edited November 13, 2018 by heizung124 Share this post Link to post Share on other sites