|
| 15 Aug 2013 06:06 PM |
| How would I make a command to where I can say kill/playername and that player will die? I know how to use the .Chatted event and I have made commands with it, I just want to know how to make it with specified arguments if you know what I mean. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Aug 2013 06:09 PM |
| Ok, but how would I seperate the kill/ from the playername in the code? |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Aug 2013 06:13 PM |
Player.Chatted:connect(function(Message) if string.sub(Message:lower(), 1, #"kill/") == "kill/" then local Rest = string.sub(Message, #"kill/"+1) print(Rest) end end) --- If the player Chats "kill/123", output would be. >123 |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2013 06:14 PM |
| How would I seperate the kill/ from the player's name, because if I were to have a function that printed what I said it would print kill/Saviorofdragons if I said that, how would I isolate the player's name so that I can find it? |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2013 06:15 PM |
| Well thanks for ignoring my post... |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2013 06:15 PM |
| lol, sorry I was trying mine when yours came up. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Aug 2013 06:24 PM |
| Ok, thanks. But one more question, what does string.sub do? I think it cuts a string at a certain part but I have no idea. |
|
|
| Report Abuse |
|
|