Displaying a trains station stopping pattern using :GetChildren()?
Hi there, basically im trying to get a platform display to show the stations that the train is stopping at in the correct order but im not sure how to use :GetChildren() and have it display in the correct order and also with commas in between.
eg. it should say "Station1, Station2 & Station3" but atm the best i can figure out is getting it to display 1 of the stations.
I was using :GetChildren() because I want it to work with different train services with different amounts of stations en-route so sometimes the display might say "Station1, Station2, Station3, Station4, Station5 & Station6" other times it might be more or less stations. Thanks for the help :)
1 | local stations = player.PlayerGui.SwitchGui.Stopping_Pattern.StationsList:GetChildren() |
2 | local switchesgui = player.PlayerGui:WaitForChild( "SwitchGui" ) |
3 | local stoppingPatternFolder = switchesgui:WaitForChild( "Stopping_Pattern" ) |
4 | local nextstation = stoppingPatternFolder:WaitForChild( "NextStop" ) |
5 | local nextstation_text = nextstation.Value |
6 | local station = game.Workspace:WaitForChild(nextstation_text) |
8 | station.P 1. Screen 1. Scroller 1. Label.Text = stations [ i ] |
I know this isn't how you do it because it only displays the last station on the display instead of them all.