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)

2 comments

1

I doubt it will help but I would recommend you use "Character:SetPrimaryPartCFrame(game.workspace.NormalPlanePart.CFrame)", moving the torso use to kill the character.

1

Plus if their character is R15, there are two torso.