generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: AdminScript issues :c

Previous Thread :: Next Thread 
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
09 Dec 2015 01:26 PM
I wanted to make my own admin script for public use. Though I hate string manipulation, I can't get this working. It finds the command after the prefix, but it won't find the player. What I'm trying to do in this function is to return the command found in the text, and also the sub of the text of where the player's name should be found. Example:

(kill Player

So the function should return a sub of 5. So the getplr function starts at a sub of 5 to locate the player. I printed the sub it returned, and it only printed 1 blank space. e.e Here's the primary function that returns the sub.

local getcmd = function(txt) --Function to find the command written in the text
for i,v in pairs(commands) do --commands is a tables which contain string
local matching = 0
local length = string.len(v[1])
local runtime = 1
for i = 2,#txt do
if txt:sub(i,i) == v[1]:sub(runtime,runtime) then
matching = matching + 1
end
if matching >= length then
return v,i + 1 --'i+1' is the sub
end
runtime = runtime + 1
end
end
end
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
09 Dec 2015 01:34 PM
First bump It starts at the 2 char of the string in the for loop to avoid the prefix.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image