Hello, i know i’m kinda late… I mean not kinda, i am 2 years late… But i still wanna help if you didn’t find solution and didn’t abandone the project or even roblox.
So, what this person said is that you use teleport service to teleport players, but you also need to put data inside which can’t be an instance. In the tower game itself, when player joins you get player data you sent from the lobby.
So what are you gonna do in the lobby script, is that you should get all your data and put it in table, and then teleport it with player.
Here’s the teleportation script
local TeleportService = game:GetService("TeleportService")
--Put all needed data in this table just like here:
local TPData = {
Tower1 = Player.Tower1.Value,
Tower2 = Player.Tower2.Value,
Tower3 = Player.Tower3.Value,
Tower4 = Player.Tower4.Value,
}
local TeleportOptions = Instance.new("TeleportOptions")
TeleportOptions:SetTeleportData(TPData)
pcall(function() -- We would like to teleport the player with a "Protected Call" function, Because like any call that involves network requests, They have a possibility to fail.
TeleportService:Teleport(PlaceID, Player, TeleportOptions)
end)
Now you teleported player, so we are going to the main game script.
game:GetService("Players").PlayerAdded:Connect(function(Player) -- Fires whenever a Player has joined.
local Data = Player:GetJoinData() --Now we are getting the table we sent before
local TPData = Data.TeleportData
local Tower1Name = TPData.Tower1 --And you do the same with tower 1, tower 2 and so on. Just make sure that you didn't put instance in the table and you are using right names of the values inside of it.
print(Tower1)
end)
Hope i could explain to you how to use it. Have in mind that i used @CFramedDev script, i just wanted to try to explain you little bit better how to use it. If it helped you make sure to check solution on him, not me. (beacuse i didn’t write the script, i just changed it little bit for your case hoping you can understand it better)