Quote:
Originally Posted by cbk1994
PHP Code:
function onActionServerSide(cmd, target, msg) { if (cmd == "tell") { temp.pl = findPlayerByCommunityName(target); if (pl == null) { return player.chat = "(player not found)"; } pl.triggerClient("gui", this.name, "tell", player.communityname, msg); } }
//#CLIENTSIDE function onPlayerChats() { if (player.chat.starts("tell")) { // format is: tell account "message here" temp.tokens = player.chat.tokenize(); temp.acc = tokens[1]; temp.msg = tokens[2]; triggerServer("gui", this.name, "tell", acc, msg); } }
function onActionClientSide(cmd, sender, msg) { if (cmd == "tell") { player.chat = sender @ ": " @ msg; } }
To use this you would say: tell cbk1994 "Hi there ugly!"
|
Instead of creating a new thread I'm just going to bump this, sowwwy.
I have been trying to sharpen my scripting skills lately and I ran into a problem with this.. The script works fine and everything but I don't understand why we have to put the quotation marks around the "message" or else it wont register. I believe there is another way to read the player chat but I'm unsure of it.