Hello! And thank you for your interest in my question. I'm starting to learn lua and I came across this problem.
I want a humanoid to move to one of 4 bricks, choosing it's destination at random. The error I'm facing is "str1 is not a valid member of Model". I think I have an idea of why I came across this error, is there any way around it?
If you have a better suggestion on how I can do this, please share!
whereTo = game.Workspace.test2.possibleDestination
walker = game.Workspace.test2.Walker2.Humanoid
--inside "whereTo" I have a few bricks named "way1" "way2" "way3" "way4"
position = math.random(4)
str0 = (".way" .. position)
str1 = (tostring(whereTo) .. str0)
walker:MoveTo(str1.Position)
Thank you for your time :-)

1 comment
This works! Thank you