I’m trying to make a customizable lobby queue system, but the script I have between places are not working, and is not correctly sending or gathering the teleport data.
This is my first script, inside server storage on the main place.
local TeleportService = game:GetService("TeleportService")
local placeid = 76907332352013
game.Players.PlayerAdded:Connect(function(player)
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions.ShouldReserveServer = true
local teleportData = {
Difficulty = 1,
Map = 3,
PlayerCount = 4,
}
teleportOptions:SetTeleportData(teleportData)
TeleportService:TeleportAsync(placeid, {player}, teleportOptions)
end)
And my second script, also in server storage in the second place, where the data should be getting sent to.
game.Players.PlayerAdded:Connect(function(player)
local joinData = player:GetJoinData()
local teleportData = joinData.Teleportdata
--[[script.Difficulty.Value = teleportData.Difficulty
script.Map.Value = teleportData.Map
script.Players.Value = teleportData.PlayerCount]]
local difficulty = teleportData.Difficulty
local Map = teleportData.Map
local PlayerCount = teleportData.PlayerCount
print(difficulty)
print(Map)
print(PlayerCount)
end)