local Player= game.Players.LocalPlayer local Cam = workspace.CurrentCamera local TeleportService = game:GetService("TeleportService") local Mouse=Player:GetMouse() Mouse.Button2Down:connect(function() if Cam.CameraSubject== workspace.Yellow then TeleportService:Teleport(Player,184968122) elseif Cam.CameraSubject==workspace.Green then TeleportService:Teleport(Player,182114422) end end)
I doubt this should work on play solo mode so I tried it on a normal server and it just errors as "Unable to cast Instance to int". This is in a localscript inside of StarterGui(I feel kind of bad asking since I feel like its an obvious mistake, and yes, this is my first time trying to use TeleportService)
The :Teleport()
method's arguments go in the order of Place ID, THEN the player. You have them switched, so just change line 7 to this:
TeleportService:Teleport(184968122,Player)
and line 9 to this:
TeleportService:Teleport(182114422,Player)
and you're good to go! (Assuming the Place IDs are correct)