CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 18 Dec 2012 01:07 AM |
if command:lower() == "kill" then if game.Players:findFirstChild(argument) then local x = game.Players:findFirstChild(argument) if x.Character.Humanoid then x.Character.Humanoid.Health = 0 end end
How would I make it to where I can type the argument (player) in upper or lower case letters, and still have it work? Also, how would I make it to where you don't have to type in the full name and still have the script function correctly. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2012 01:33 AM |
| I think you would do something with upper(arguement) so if you typed "kill ob" it would look and see if the upper part of anyone's name starts with ob and then kill them. Still a rookie, trying to help but yeah. :P |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
| |
|
|
| 18 Dec 2012 11:12 AM |
| You have to make your own FindFirstChild method. Also use string.match. |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 18 Dec 2012 05:02 PM |
What would I do to make it to where I can have the argument be typed in lower case and still function correctly?
string:lower(argument) ? |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
| |
|
Solotaire
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 30356 |
|
|
| 18 Dec 2012 05:24 PM |
| if string.lower(chattedMessage) == string.lower(yourcommand) then |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 18 Dec 2012 05:29 PM |
If that's the case, would this line work?
if command:lower() == "kill" then
|
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 18 Dec 2012 05:35 PM |
game.Players.PlayerAdded:connect(function (p) p.Chatted:connect(function (command) if command:lower():sub(1,5) == "kill/" then x = command:sub(6,#command) playertokill = game.Players:findFirstChild(x) playertokill.Character:BreakJoints() end end) end)
--ends be off |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 18 Dec 2012 05:38 PM |
| The ends don't really matter in this particular piece of the script, as this isn't the whole script. |
|
|
| Report Abuse |
|
|