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
 

Using two subs

Previous Thread :: Next Thread 
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
13 Oct 2015 09:01 AM
With things like creating admin commands, I always run into problems with commands such as teleport. For instance, I'll have something like this to find things.

if m:sub(1,4) == Prefix.. "tp " then
local startplr = findPlr(m:lower():sub(5))
local newplr = findPlr(m:lower():sub(7))
startplr:MoveTo(findplr.Torso.Position)
end

Now, of course, that isn't what I'm going to actually use but it does use the same methods as I would normally use. 5 is where the first name would be and 7 is where the next name would be. But, for some reason, it never works like that so I'm assuming that I'll have to use something else with the sub to find the second name. What could I use to accomplish this?
Report Abuse
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
13 Oct 2015 09:04 AM
http://wiki.roblox.com/index.php/String_pattern
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
13 Oct 2015 09:05 AM
I don't see how string patterns would help much at all, other than eliminating the spaces.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
13 Oct 2015 09:10 AM
It's easy I'll post solution in like 20 mins when im home
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
13 Oct 2015 09:24 AM
I'm using this

function getArgs(str,char)
local args = {}
for S in str:gmatch("[^"..char.."]+") do
table.insert(args,S)
end
return args
end

a friend of mine quickly made it because I don't understand string patterns at all
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