|
| 11 Jul 2016 09:40 AM |
local wArray = game.Workspace:GetChildren();
for i = 1, #wArray do local item = wArray[i]; if string.starts(item.Name, "Part") then print(item.Name); end end
It won't print anything in console. I'm trying to check whether certain parts start with "Part" and printing out their full names. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 09:45 AM |
if string.match(item.Name, "^Part") then
That's the only way I know to do things, I don't recall ever hearing about string.starts as a function. It may be, of course, but I don't know a thing about it.
|
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 09:50 AM |
Holy cow thanks it works.
string.starts(string, firstLetters) was supposed to return a boolean value according to some wikis I read but I probably used it wrong/wasn't a good idea to use, but it was so hard to understand :|. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 09:51 AM |
It might also be unavailable in Lua 5.1, which is what Roblox uses. It's probably a 5.2 or 5.3 thing.
|
|
|
| Report Abuse |
|
|