Cant read table in one script, but can in another

Hello… it is me… again…
So there is a racing game where you race on foot… blah blah let’s get to it.

so there is an ordered table and one script can read it (the counting script) and the other says there is nothing there (other scripts can read this table just fine).

here is the script:

function endscreen()
local listend = false
local cycle = 0
script.Parent.ScrollingFrame.Visible = true
repeat
	if _G.PlayerPos[cycle] ~= nil then
		cycle = cycle + 1
		script.Parent.ScrollingFrame.Frame:Clone().Parent = script.Parent.ScrollingFrame.PlaceFolder
		script.Parent.ScrollingFrame.PlaceFolder.Frame.Name = "place of " .. _G.PlayerPos[cycle][1]
		script.Parent.ScrollingFrame.PlaceFolder["place of " .. _G.PlayerPos[cycle][1]].Visible = true
		script.Parent.ScrollingFrame.PlaceFolder["place of " .. _G.PlayerPos[cycle][1]].PName.Text = _G.PlayerPos[cycle][1]
		script.Parent.ScrollingFrame.PlaceFolder["place of " .. _G.PlayerPos[cycle][1]].PTime.Text = _G.PlayerPos[cycle][2]
		script.Parent.ScrollingFrame.PlaceFolder["place of " .. _G.PlayerPos[cycle][1]].PImage.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=" .. game.Players[_G.PlayerPos[cycle][1]].UserId
	end
until _G.PlayerPos[cycle] == nil
wait(5)
script.Parent.ScrollingFrame.Visible = false
script.Parent.ScrollingFrame.PlaceFolder:ClearAllChildren()
end

workspace.Ended.Event:Connect(endscreen)

anyway… can you guys help?

I recommend using a module script if you want shared tables, you basically declare a module variable and assign it to a table (inside the module script)

module.TableName = {}

You can require this by both scripts and edit/read the table.

2 Likes

Hmm…
Why didn’t i think of that?
Thx i’ll try it tomorrow.