an example of my problem is i keep ending up with my scripts starting like this
1 | local model = game.Workspace.model |
2 | local partA = model.partA |
3 | local partB = model.partB |
4 | local partC = model.partC |
and i keep having to repeat that for several lines of code.
To do this you would use the :GetChildren() method which returns all the Children of that place as a table, and then use in pairs() to have use this table, as so:
1 | Variable = game.Workspace:GetChildren() |
2 |
3 | for Table,Index in pairs (Variable) do |
4 | if Index:IsA( "Part" ) then |
5 | Index.Transparency = 0 |
6 | end |
7 | end |
1 | for i,v in pairs (game.Workspace.model:GetChildren()) do |
2 | v.Transparency = 1 -- example of code |
3 | end |