UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 02 Feb 2013 08:26 PM |
Hey guys, I'm working on the "Scripters admin script" An overused script that all scripters should use. It's going to have a butt-ton of functions. I'm a little stumped right now. All I have is:
_G.randomNum(number value of how many decimals you want, number value highest/lowest number, number value of highest/lowest value) _G.getRange(number 1, number 2) Will always subtract the highest number from lowest _G.randomText(number value of how many characters you want, true false or nil (True will return a string with upper and lower case characters while false will return a string with uppercase characters and nil will return a string with all lowercase letters ))
_G.tEmpty(table) Will return a bool to see if table is empty or not
Any ideas? I was thinking about a averaging function so don't say that.
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2013 08:29 PM |
_G.convertIntoTime(seconds)
Returns
(hours,minutes,seconds)
So _G.convertIntoTime(60)
would return (0,1,0)
|
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 02 Feb 2013 08:31 PM |
| I did something like this ages ago, the truth is that most of the processes you can automate can be easily done without the hassle of debugging a script that is written by someone else. |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 02 Feb 2013 08:36 PM |
I don't need no debuggin'.
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 02 Feb 2013 08:39 PM |
| It's not what you don't need, it's when your script does something that contradict's the user's actions, making the whole project a bit of a waste. |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2013 08:49 PM |
| Did you know that eenie meenie miney moe is people[15%#people+1] ? |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 02 Feb 2013 08:55 PM |
I'm including all kinds of conditionals. For example if someone inserts a string value into where a number value should be it will check to see if the string is a number or just text. However the way I have it setup right now will slaughter output.
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2013 06:02 AM |
_G.getRange(number 1, number 2)
math.abs works fine. You don't need that. |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2013 06:10 AM |
other suggestions :
function to find the next prime number x = 277 print(unpack(_G.nextPrime(x)) > 281
function to remove duplicates from a table t = {2, 2, 1, 5, 4, 5} print(unpack(_G.removeDups(t))) > 2, 1, 5, 4
function to shuffle a table t = {1, 2, 3, 4, 5} print(unpack(_G.shuffleTable(t))) > 3, 1, 2, 5, 4
function to invert a table t = {1, 2, 3, 4, 5} print(unpack(_G.invertTable(t))) > 5, 4, 3, 2, 1
function to sort a table in alphabetical order t = {"bear","ball","air"} print(unpack(_G.sortTable(t))) > air ball bear
|
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 03 Feb 2013 07:11 AM |
Thank you for your contribution :)
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2013 02:32 PM |
Random string generator : function GetRandom(Length) local Rtn = "" repeat Rtn = Rtn .. tostring(string.char(math.random(37,127))) until #Rtn == Length return Rtn end
"Don't believe everything you read online" - Abraham Lincoln |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2013 02:54 PM |
Here is another;
_G.createLaser(vector31,vector32,thickness)
returns
(object) |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 07:29 PM |
How 'bout this:
_G.soloTest
returns true if the only player in the game is Player1 and has a userId of -1. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 07:43 PM |
A createObject function? Can be used like so: _G.createObject( "Part", workspace, {Name = "Test", BrickColor = BrickColor.new("Really black")})
Better yet, here you go: _G.createObject = functon(type, parent, properties) local obj = Instance.new(type, parent) for a, b in pairs(properties) do pcall(obj[a] = b) end end
[ AbsoluteLOL - TFN Prime General ] |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 07:46 PM |
I misspelled "function" :(
[ AbsoluteLOL - TFN Prime General ] |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 07:47 PM |
Aaaand it doesn't work... fail
[ AbsoluteLOL - TFN Prime General ] |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2013 07:49 PM |
Fixed. _G.create = function(type, parent, properties) local obj = Instance.new(type, parent) for a, b in pairs(properties) do if (obj[a] ~= nil) then obj[a] = b end end end
[ AbsoluteLOL - TFN Prime General ] |
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 05 Feb 2013 07:59 PM |
easy
_G.randomNum = wat _G.getRange = function(n1, n2) return math.abs(n1 - n2) end _G.randomText = function(numChar, type) local text = "" for i = 1, numChar do text = text .. (type == true and tick()%2 == 0 and string.char(math.random(97, 122)) or string.char(math.random(97, 122)):upper() or type == false and string.char(math.random(97, 122)):upper() or string.char(math.random(97, 122))) end return text end
_G.tEmpty = function(tbl) return #tbl == 0 end |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 05 Feb 2013 08:48 PM |
It would be much better if we could get a sandboxed compiler where we can do this:
ga.work.Que.Hum.Health = 0;
I'd use that a lot more then another library like jCommands... |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 05 Feb 2013 08:54 PM |
Much like -e?
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 06 Feb 2013 07:14 AM |
Well here are _some_ of the basics of what I made. I know the random text is a bit funny but too bad. pastebin/fjzz4ypt
~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~ |
|
|
| Report Abuse |
|
|