So, im trying to make a game sharing game, so you can share your places and players would join but the teleport is not working (this is a simple script that is controlled), i tried doing tonumber() but everytime nothing works
for i,place in pairs(games) do
if place then
local icon = "https://games.roproxy.com/v1/games/"..place.id.."/icon"
local data1 = game.HttpService:JSONDecode(game.HttpService:GetAsync("https://games.roproxy.com/v1/games?universeIds="..place.id))
local rootPlaceId = tonumber(data1["data"][1]["rootPlaceId"])
local data = game.HttpService:JSONDecode(game.HttpService:GetAsync(icon))
local imageId = data["imageId"]
if imageId then
local clone = script.Frame:Clone()
clone.Parent = workspace.Part.SurfaceGui.Frame
clone.ImageLabel.Image = "rbxassetid://"..imageId
clone.Join.MouseButton1Click:Connect(function()
game["Teleport Service"]:TeleportAsync(rootPlaceId, player)
end)
else
local clone = script.Frame:Clone()
clone.Parent = workspace.Part.SurfaceGui.Frame
clone.Join.MouseButton1Click:Connect(function()
game["Teleport Service"]:TeleportAsync(rootPlaceId, player)
end)
end
end
end