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 » Scripting Helpers
Home Search
 

Split string?

Previous Thread :: Next Thread 
dynamited3 is not online. dynamited3
Joined: 24 Jul 2008
Total Posts: 26
27 Nov 2011 08:04 AM
Hi! I'm trying to split up my string for my command, so I could type:
part 5 4 2 true
part being the command.
5 being X
4 being Y
2 being Z
and true being anchored.
And it would make a part with those dimensions/properties.
I have no idea how I would use things like gmatch and match to split this string up. Any help would be greatly appreciated.
Thanks,
--{{ Ðƴηαмḯt℮ḓ3 }}--
--{{ Scripter and builder }}--
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
27 Nov 2011 08:33 AM
This would be easy if roblox had string.Explode, like any other lua. Give me a minute or three.
Report Abuse
AeroMcFly is not online. AeroMcFly
Joined: 16 Jul 2008
Total Posts: 546
27 Nov 2011 08:35 AM
Well, pulling those numbers out of there wouldn't be too difficult:

local str = "5 4 2"
local Size = {}
for s,k in str:gmatch("%d+") do
table.insert(Size,tonumber(s))
end
Size = Vector3.new(unpack(Size))
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
27 Nov 2011 08:43 AM
I have something similar, but yours is better. Use his.
Report Abuse
dynamited3 is not online. dynamited3
Joined: 24 Jul 2008
Total Posts: 26
27 Nov 2011 08:44 AM
Thanks, worked perfectly.
Report Abuse
AeroMcFly is not online. AeroMcFly
Joined: 16 Jul 2008
Total Posts: 546
27 Nov 2011 08:56 AM
I'm sure there is a way to get that 'true' out of there too, but I'm not very good with string patterns yet
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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