so I’m Currently working on a Game with a menu that Teleports to the Main Game but I’ve been having Issues while Scripting
the Script won’t Teleport and I’m Very New to coding and Have tried Learning on Several other Platforms but they are for a Game not a Place in a Game
local RealCityX = ScreenGui.RealCityX
local TeleportService = game:GetService("TeleportService")
local Player = game.Players.LocalPlayer
local PlaceID = 10975225421
RealCityX.MouseButton1Up:Connect(function()
TeleportService:Teleport(PlaceID, Player)
end)
Do keep in mind teleports do not work inside of Roblox Studio.
Are there any errors in Roblox Studio’s output? In the developer console when you press F9 in-game?
local RealCityX = game.StarterGui.ScreenGui.RealCityX
local TeleportService = game:GetService("TeleportService")
local Player = game.Players.LocalPlayer
local PlaceID = 10975225421
RealCityX.MouseButton1Click:Connect(function()
TeleportService:Teleport(PlaceID, Player)
end)