So I have defined a global table (first time using klol) and I want it to use the first option in the table in a path
IE. game.Workspace.Spawns._G.StartingPlaces[1].
error: _G is not a valid member of spawns
_G.StartingPlaces = {"StartingPlaceOne","StartingPlaceTwo","StartingPlaceThree"} print(_G.StartingPlaces[1].."Loaded") print(_G.StartingPlaces[2].."Loaded") print(_G.StartingPlaces[3].."Loaded") while true do for timewait = 5, 0, -1 do wait(1) game.StarterGui.PeopleInGame.Time.Text = timewait end game.StarterGui.PeopleInGame.Time.Text = "Time" s = game.Workspace.Spawns p = game.Players:GetChildren() for i = 1, #p do if game.Workspace:FindFirstChild(p[i].Name) then p[i].Character.Torso.CFrame = s._G.StartingPlaces[1].CFrame * CFrame.new(math.random(-3,3),8,math.random(-3,3)) --halpls end script.Parent.NumberOfPeopleInGame.Value = #p end end
Everytime you use _G.StartingPlaces in the format something._G.StartingPlaces, replace it with:
something[_G.StartingPlaces[whatever]]
IE. game.Workspace.Spawns[_G.StartingPlaces[1]]