Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage:
- say tool:set <player.variable> <value>
- so e.g.
- tool:set x 5
- or
- tool:set ani walk
- etc
- didn't have much ideas on what else to add ^^"
- */
- function onActionServerSide()
- {
- if(!(findeapon(this.name) in player.weapons)) return;
- switch(params[0])
- {
- case "set":
- {
- temp.attrName = params[1][0];
- params[1].delete(0);
- player.(@temp.attrName) = strjoin(params[1]," ");
- }
- break;
- }
- }
- function strjoin(arra,sep)
- {
- temp.ret = "";
- for(temp.i=0;temp.i<arra.size();temp.i++)
- {
- if(temp.ret!="") temp.ret @= sep;
- temp.ret @= arra[temp.i];
- }
- return temp.ret;
- }
- // Scripted by *Inari (Inari)
- //#CLIENTSIDE
- function onPlayerChats()
- {
- if(player.chat.starts("tool:"))
- {
- temp.toks = player.chat.tokenize(" ");
- temp.cmd = temp.toks[0].substring(5);
- temp.toks.delete(0);
- switch(temp.cmd)
- {
- case "set":
- {
- triggerServer("gui",this.name,"set",temp.toks);
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement