001 Posted May 5, 2017 Share Posted May 5, 2017 WARNING: ***/client.lua:3" Bad argument @ 'outputChatBox' [Expected number at argument2,got player] Link to comment
^iiEcoo'x_) Posted May 5, 2017 Share Posted May 5, 2017 (edited) bool outputChatBox ( string text [, int r=231, int g=217, int b=176, bool colorCoded=false ] ) ًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًزًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًًً Edited May 5, 2017 by #_iMr.[E]coo Link to comment
001 Posted May 5, 2017 Author Share Posted May 5, 2017 addEventHandler( "onClientPlayerSpawn" , getRootElement (), function () outputChatBox( getPlayerName(source).." Has Spawned ", source) end ) its my first script Link to comment
pa3ck Posted May 5, 2017 Share Posted May 5, 2017 That is because on client side you don't specify a player element. Remove source after the comma. Link to comment
^iiEcoo'x_) Posted May 6, 2017 Share Posted May 6, 2017 addEventHandler ( 'onClientPlayerSpawn' , root , function ( ) outputChatBox ( getPlayerName ( source ) .. ' Spawn ! ' ) end ) Link to comment
001 Posted May 6, 2017 Author Share Posted May 6, 2017 1 hour ago, #_iMr.[E]coo said: addEventHandler ( 'onClientPlayerSpawn' , root , function ( ) outputChatBox ( getPlayerName ( source ) .. ' Spawn ! ' ) end ) i've to leave space between getPlayerName and ( source ) ? Link to comment
^iiEcoo'x_) Posted May 6, 2017 Share Posted May 6, 2017 Source The source of this event is the player that spawned. Link to comment
pa3ck Posted May 6, 2017 Share Posted May 6, 2017 No the space between brackets doesn't make any difference (source) and ( source ) is exactly the same, the code is a bit easier to look at with spaces. 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