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)
...