|
| 18 Jan 2012 02:17 PM |
| i need help making my own admin commands script |
|
|
| Report Abuse |
|
| |
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 18 Jan 2012 02:41 PM |
Events and string functions? >.>
Anyway.. He asked for help making them. You may be right, but don't judge him, just yet..
Well, if you still wish to do it, canyon, it's not too difficult. http://wiki.roblox.com/index.php/PlayerAdded_(Event) http://wiki.roblox.com/index.php/Conditional_statements#If http://wiki.roblox.com/index.php/Chatted http://wiki.roblox.com/index.php/Function_Dump/String_Manipulation http://wiki.roblox.com/index.php/String_Patterns http://wiki.roblox.com/index.php/Conditional_statements#Elseif
.PlayerAdded will return the player that joined as the first argument. Check if that Player's name is that of one of your admins with the use of an 'if' conditional statement. '.Chatted' on that Player will return what they said as a string as the first argument. Learn `string.sub()`, `string.lower()`, and `string.match()`. After you learn them, manipulate the string. If the sub-string of what was said (characters 1-x), then continue. Loop through the Players, and match a Name. You can use the `string.match()` manipulation, and only have to say part of the name, by the way. Do what your command would do. Now, use an `elseif` to check for your next command sub-string, and continue the pattern.
If you want to use string patterns, I recommend reading that wiki page and learning the different patterns and what adding capitals or different math operators would do to it. Also, learn `string.gmatch()`.
It's really not very difficult. Feel free to ask questions! |
|
|
| Report Abuse |
|