| Blockland Forums > Modification Help |
| Scripts activated by message |
| (1/2) > >> |
| sk8r159:
Hello...I want to make a script that when you type something such as /hug name it will show up in the message as (name) hugged (name). I have looked at alot of other addons like emotes but I just dont know how I would do it like that...Could someone please help me out. Thanks, Sk8r159 |
| Éagen:
--- Code: ---function serverCmdHug(%client,%target) { if(%client.isAdmin == true && isObject(findclientbyname(%target))) { echo("serverCmdHug triggered by "@%client.name@" and was targetting "@findclientbyname(%target).name@"!"); if(isObject(findclientbyname(%target).player)) { messageAll('',findclientbyname(%target).name@" was given a hug by "@%client.name@"."); } } } --- End code --- When you type /hug it will say to everone (Name) was given a hug by (Name) For example if you typed /hug Example it would say, Example was given a hug by sk8r159. Edit:I made it admin only so it wouldnt ge abused. |
| sk8r159:
Thanks |
| herb:
inafterspoonfeeding |
| Crysist:
--- Quote from: Éagen on July 24, 2010, 05:27:48 PM --- --- Code: ---function serverCmdHug(%client,%target) { if(%client.isAdmin == true && isObject(findclientbyname(%target))) { echo("serverCmdHug triggered by "@%client.name@" and was targetting "@findclientbyname(%target).name@"!"); if(isObject(findclientbyname(%target).player)) { messageAll('',findclientbyname(%target).name@" was given a hug by "@%client.name@"."); } } } --- End code --- When you type /hug it will say to everone (Name) was given a hug by (Name) For example if you typed /hug Example it would say, Example was given a hug by sk8r159. Edit:I made it admin only so it wouldnt ge abused. --- End quote --- You didn't package it, it will overwrite the default command. Also thats just the kill command from RTB Wiki with the killing part taken out, and if you make such a command you won't need to check if the player is there. |
| Navigation |
| Message Index |
| Next page |