| Blockland Forums > Modification Help |
| Debugging error much? |
| (1/2) > >> |
| I-have-not:
So I loaded a script on: --- Code: ---function ServerCmdBLID(%target) { NewChatHUD_AddLine("\c2"%target"BL_ID is: \c6"%target.bl_id""); } --- End code --- but for some reason it gave me this error? There's an error with the debugger: And when I agree to let go of each letter, it just moves on to the next one! Help Plz? |
| Slicksilver:
@ is the string connector in torque. Insert it between strings (the thingies with quotes around them) and other strings or variables. function ServerCmdBLID(%target) { NewChatHUD_AddLine("\c2" @ %target @ "BL_ID is: \c6" @ %target.bl_id @ ""); } Aside from that, you need to use %target.getPlayerName() or %target.name not %target. You also need to add %target = findClientByName(%target); at the top of the function. |
| jes00:
Is this supposed to be client sided or server sided? |
| Scout31:
--- Code: ---function serverCmdBLID(%client, %target) { messageClient(%client, '', "\c2" @ %target.name @ " BL_ID is: \c6" @ %target.bl_id); } --- End code --- When using a server command, the first argument is the person who used it. The rest are whatever you want them to be. When transitioning between different string variables, or just strings, you must put a @. NewChatHUD_addLine only works on client, serverCmd only works on the server. |
| Slicksilver:
--- Quote from: Scout31 on February 11, 2012, 10:56:46 AM ---When using a server command, the first argument is the person who used it. The rest are whatever you want them to be. When transitioning between different string variables, or just strings, you must put a @. NewChatHUD_addLine only works on client, serverCmd only works on the server. --- End quote --- How did I even loving not notice that? I honestly feel handicapped right now. |
| Navigation |
| Message Index |
| Next page |