|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|