amm2100 Posted July 8, 2015 Share Posted July 8, 2015 (edited) Hi , 1st I am newbie to Script I start since 2 Days I need help in bindkey x to show the cursor My Code bindKey ( "x", "down", function () showCursor( true ) end ) Help Me Please That The Error I got in Console :[23:11:32] WARNING: myserver\script.lua:33: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'x'] Notice bindKey ( "x", "down", This is Line 33 Edited July 16, 2015 by Guest Link to comment
wastelandrp Posted July 8, 2015 Share Posted July 8, 2015 bindKey ( player, "X", "down", functionName ) function functionName() showCursor( true ) end Link to comment
amm2100 Posted July 8, 2015 Author Share Posted July 8, 2015 Same Error [23:48:02] WARNING: myserver\script.lua:33: Bad argument @ 'bindKey' [Expected player at argument 1, got nil] Line 33 is bindKey ( player, "X" , "down", functionName ) and Not Working Link to comment
Dealman Posted July 8, 2015 Share Posted July 8, 2015 You're trying to bind the key server-side, so obviously you need to tell the server what player should bind the key. You can't just assume that the server will magically know what you want. You need to define "player", it is returning nil because it's empty - it doesn't contain anything. You'd be better off doing this in a client-side script instead; function testFunction() showCursor(not isCursorShowing()) -- Toggles between true and false end bindKey("X", "down", testFunction) Link to comment
amm2100 Posted July 9, 2015 Author Share Posted July 9, 2015 [04:46:00] WARNING: myserver\script.lua:36: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'X'] Still not Working :\ Link to comment
amm2100 Posted July 9, 2015 Author Share Posted July 9, 2015 You're trying to bind the key server-side, so obviously you need to tell the server what player should bind the key. You can't just assume that the server will magically know what you want.You need to define "player", it is returning nil because it's empty - it doesn't contain anything. You'd be better off doing this in a client-side script instead; function testFunction() showCursor(not isCursorShowing()) -- Toggles between true and false end bindKey("X", "down", testFunction) I made it on client-side and It Work :3 Ty very Much sorry I am Noob Scriptwriter Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now