Blockland Forums > Modification Help
Greeting script help
(1/4) > >>
PNetwork2011:
Another post dedicated to Pacnet2011.
---------------------------------------------------------

--- Quote from: Pacnet2011 ---I've got a problem with this script i was making. A greeting script. It doesn't say hello to someone but it does say bye to someone.
Example.

RootBeerDude connected.
(nothing)
RootBeerDude has left the game.
Pacnet2011: Bai, RootBeerDude

Here's the script


--- Code: ---package greetmod
{
function newChatHud_addLine(%text)
{
Parent::newChatHud_addLine(%text);
%nameToGreet = strReplace(%text," connected.","");
if(%nameToGreet !$= %text)
{
commandtoserver('messagesent',"Hai, " @ %nameToGreet);
}
}
function newChatHud_addLine(%text)
{
Parent::newChatHud_addLine(%text);
%nameToGreet = strReplace(%text," has left the game.","");
if(%nameToGreet !$= %text)
{
commandtoserver('messagesent',"Bai, " @ %nameToGreet);
}
}
};
activatePackage(greetmod);

--- End code ---

--- End quote ---
PNetwork2011:

f
Nexus:
the second argument is messageclient(); is the type of message, and I believe messagedisconnect is an option, but I'm not sure if that is exactly how it is said.

Not sure how to package that on the client side, though.  Need to look up what clientcmd receives that
Headcrab Zombie:
It's because your redefining the same function twice within the same package, so the game goes with the second redefinition of the function, which it the one containing the goodbye.
DrenDran:
No.
Please no.
Autogreeter scripts are usually spam, and most decent hosts will force you to turn it off or kick you.
Please do not contribute to making an autogreeter.
Navigation
Message Index
Next page

Go to full version