|
| 18 Feb 2014 10:27 AM |
| Is it possible to use "findFirstChild" to find anything that starts with sword? Like for example within this frame, there could be "swordiron" or "swordsteel", so if either of them is there, i dont care which, it will continue on with code. I tried string.sub but as far as i know you need a string, and i dont know what the full string would be. |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 18 Feb 2014 10:30 AM |
you would use
if string.sub(lol.Name, 1, 5) == "sword" then
end
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2014 10:31 AM |
| whats lol though? how do i define that? |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 18 Feb 2014 10:33 AM |
for _, lol in pairs(script.Parent:GetChildren()) do --get every child of script's parent if string.sub(lol.Name, 1, 5) == "sword" then --filter the children out by name print'Name starts with Sword' end end
|
|
|
| Report Abuse |
|
|
| |
|