Author Topic: Changing avatar colors to transparent on other servers using a script.  (Read 4330 times)

Hello recently, since none of my other projects have been working out, I wanted to make a little private script that would change my avatar's colors instantly. I think I found what I'm supposed to do but the code didn't work. Here's the code


Code: [Select]
package cape
{
function serverCmdcape(%client)
{
%client.applyBodyParts();
%client.packcolor = $pref::Avatar::PackColor = "1 0 0 0.5";
}
}
activatepackage ("cape");

Help would be very much appreciated.

« Last Edit: March 02, 2009, 07:09:40 PM by gamefandan »

I think your problem is that you're saying a variable = another variable = another variable.

I think your problem is that you're saying a variable = another variable = another variable.

._.

/facepalm

Does this fix it?

Code: [Select]
package cape
{
function serverCmdcape(%client)
{
%client.applyBodyParts();
%client.packcolor = "1 0 0 0.5";
}
}
activatepackage ("cape");



Yeah that didn't work.

Never mind I got it to work, thanks to Space Guy for helping me.

All I need to do now is make it client sided.
« Last Edit: March 01, 2009, 03:24:18 PM by gamefandan »

Yeah I can't figure out how to make it client sided please help.


Code: [Select]
package cape
{
function serverCmdcape(%client)
{
%client.applyBodyColors();
%client.packcolor = "1 1 1 0.5";
%client.chestColor = "1 1 1 0.5";
%client.hatColor = "0 0 0 0.5";
%client.HeadColor = "1 1 1 0.5";
%client.hipColor = "0 0 0 0.5";
%client.larmcolor = "0 0 0 0.5";
%client.lhandcolor = "1 1 1 0.5";
%client.llegcolor = "0 0 0 0.5";
%client.rarmcolor = "0 0 0 0.5";
%client.rhandcolor = "1 1 1 0.5";
%client.rlegcolor = "0 0 0 0.5";
%client.secondPackColor = "1 1 1 0.5";

}
};
activatepackage(cape);

And yes, I put it in a client.cs


You cannot make client sided slash commands.
You cannot modify client variables on the client.
You can however change prefs then send the appearance data to the server.

Wouldn't you want to apply the colors AFTER you set all the variables?

I haven't done much with appearances, I don't know if there's something else wrong.

Wouldn't you want to apply the colors AFTER you set all the variables?

What do you mean? I am kinda new to scripting so I'm not sure what you mean by this.


http://www.returntoblockland.com/forums/download.php?cmd=viewFile&id=466

I do not recommend using that.
As said to Truce on MSN:

Quote
Chrono says (8:07 PM):
 lets say you wanted to make a super cool client sided /asd command, but then you join a server, and they want you to use /asd to get through a door?

Perhaps another character should've been used, such as @, %, ^ (No I don't care if CityRP uses it, they suck anyways), or some other symbol.

Edit: Also the fact it only supports up to 5 args is rather stupid. If I made it it would be infinite args.
« Last Edit: March 01, 2009, 08:18:07 PM by Chrono »

None of your suggestions are working, or I'm just doing it wrong. Can one of you please change the script around and SHOW me what's wrong? :(

What I meant is that you're applying your colours, THEN changing the values. Wouldn't you want to change the values first?

And no, this won't work clientsided.

Well if it doesn't work client sided then I did this right I guess, cause it worked on my server.

You don't need to package it if you aren't modifiying another function.

._.

DOH!

but wait..... would that matter in solving my current problem? Which would be how to make this usable on other servers besides my own.