Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to setup teleport script if the person has a gamepass, error found; how do I fix?

Asked by 6 years ago

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)
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. Bellyrium 310 — 6y
1
Plus if their character is R15, there are two torso. thesit123 509 — 6y

Answer this question