Hello!
I’m trying to make a script that teleports the player to a different experience, but I keep getting this error: “Unable to cast values to Objects”
I’m not sure why this is happening, and whether it is related to changing the GUI or the Teleporting Service.
The other posts with a similar topic were related to using :TeleportToPrivateServer and teleporting parties, but I couldn’t find any information about :TeleportAsync
Here’s the script:
script.Parent.MouseClick:Connect(function(Player)
local TS = game:GetService("TeleportService")
TS:TeleportAsync(12777737748, game.Players[Player.Name])
game.Players[Player.Name].PlayerGui.ArtInfo.Frame.dateOfCreation.Text = "Arriving soon!"
game.Players[Player.Name].PlayerGui.ArtInfo.Frame.description.Text = "We hope to see you back at The Art Museum!"
game.Players[Player.Name].PlayerGui.ArtInfo.Frame.Title.Text = "Teleporting to the AOS Museum"
end)
More information:
Target Experience: Atmospheric and Oceanic Sciences Museum - Roblox
Teleporting From: The Art Museum - Roblox