plr:GetJoinData() nil

I’m trying to make a TeleportAsync() with teleportOptions to know the owner of room.

TeleportAsync:

local TS = game:GetService('TeleportService')
local DSS = game:GetService('DataStoreService')

script.Parent.Touched:Connect(function(part)
	if part.Name == 'HumanoidRootPart' and game.Players:GetPlayerFromCharacter(part.Parent) then
		local DataStore = DSS:GetDataStore('Units')
		local UnitsList = DataStore:SetAsync(game.Players:GetPlayerFromCharacter(part.Parent).Name, {'Lula'})
		local options = Instance.new('TeleportOptions')
		local plr = game.Players:GetPlayerFromCharacter(part.Parent)
		options.ShouldReserveServer = true
		options:SetTeleportData(true)
		TS:Teleport(18710239721, plr, options)
	end
end)

GetJoinData:

...
local Owner = plr:GetJoinData().TeleportData
...
print(Owner)
...

If I remember correctly only TS:TeleportAsync() will pass join data, so use that instead of :Teleport

Thanks so much bro, you helped me TO MUCH.

2 Likes

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