Author Topic: "messageClient" is not working for me.  (Read 1502 times)

Code: [Select]
package ClassSelection
{
function serverCmdPickClass(%client, %ClassInput)
{
{
if(%ClassInput $= Knight)
{
%client.Class = 1;
%client.BaseHP = 135;
%client.BaseAttack = 160;
%client.BaseDefense = 125;
%client.BaseSpeed = 65;
%client.BaseIntellect = 50;
%client.BaseWillpower = 65;
messageClient("<color:ffffff>You are now a Knight!");

}

}
}
};
activatePackage(ClassSelection);



For some reason, when I use the command I made, I don't see the client message. What exactly am I doing wrong? (Sorry if my syntax is bad, this is my first time ever using TorqueScript)

messageClient(%client, '', "<color:ffffff>You are now a Knight!");

Second argument will probably be '' for most cases. That's two apostrophes.

The first argument is whatever client being messaged.


Also for the if statement wouldn't knight need quotes around it like  if(%ClassInput $= "Knight")? I might be wrong though.

Technically, TorqueScript doesn't care since it is only one word. But yeah it should have quotes around it anyway, just as a good practice.

Technically, TorqueScript doesn't care since it is only one word. But yeah it should have quotes around it anyway, just as a good practice.

I had no clue about that lol, I just made a whole chat mod and thought it was just how it had to be done lol.

I'm used to java so that might be why I thought that. I didn't want to come in giving advice that was completely useless.

I had no clue about that lol, I just made a whole chat mod and thought it was just how it had to be done lol.

I'm used to java so that might be why I thought that. I didn't want to come in giving advice that was completely useless.
Ikr, Torque is a weird language. It's best to always put strings in quotes though, so they don't get mixed up with object names.

Ikr, Torque is a weird language. It's best to always put strings in quotes though, so they don't get mixed up with object names.

I mean I'm still doing newb stuff but yeah I've noticed a few quirks I honestly can't think of a reason for.

Strange, I recall having quotes around it. Oh well, I edited it before, anyway. Thanks.