Attempt to index nil with (Teleport data)

You mean “TeleportData”, right?

u aint even really help me on this bruh like i appreciate the help but u barely did nothin

1 Like

yes i do mean TeleportData

local TeleportData = joinData.TeleportData

This prints to nil? What about joinData ?

joinData prints to the “table: 0x” thing whenever i teleport

1 Like

replace TeleportData with joinData and see what it says

That’s a good sign. I think your table is only nil when it’s not with the join data

wdym by that, do i just change the variable names or something else? doesnt really make sense to me

1 Like

for i, v in pairs(joinData) do
print(i,v)
end

Screenshot 2025-03-02 012021
i get these

Now in pairs(joinData.TeleportData) do

Screenshot 2025-03-02 012619

mmmh, alr, now try w joinData.TeleportData[player.Name]

Screenshot 2025-03-02 012907

The script posted has… local teleportdata = {} …missing up top and is showing an error mark in the Studio.

1 Like

ah, i finally get it now, please refer to the previous post you’ve made…
You’re using an array as if it was a dict :skull:

You’d have to do

game.Players.PlayerAdded:Connect(function(player)
	task.wait(3)
	local joindata = player:GetJoinData()
	local teleportdata = joindata.teleportdata
	
	local colonyvalue = teleportdata[player.Name][2]
end)
1 Like

over or under game.players.playeradded

local teleportservice = game:GetService("TeleportService")
local replicatedstorage = game.ReplicatedStorage
local escapeguione = replicatedstorage:WaitForChild("EscapeGuiOne")
local teleportdata = {}

So over … Then down in touched change that to:

  teleportdata = {}

You’re using the reference in:

teleportoptions:SetTeleportData(teleportdata)

So it needs to be a script global, in this case a resetting global in touched.

TeleportData is declared inside the function already, although it’s a global var… :skull:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.