Context. So I was trying to make a gui teleport button to teleport one to somewhere, and I've encountered some errors. I tried some solutions, but none of them worked. Here's the code.
wait(1) player = game.Players.LocalPlayer button = script.Parent function teleportVIPPlane() if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,890574591) then--Replace passid with the gamepass ID local torso = player.Character.UpperTorso torso.CFrame = game.Workspace.VIPPlanePart.CFrame else end end button.MouseButton1Click:connect(teleportVIPPlane)
Second gui
wait(1) player = game.Players.LocalPlayer button = script.Parent function teleportNormalPlane() local torso = player.Character.UpperTorso torso.CFrame = game.workspace.NormalPlanePart.CFrame end button.MouseButton1Click:connect(teleportNormalPlane)