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

Teleporting to a Place with a Tool?

Asked by 3 years ago

How do I make a tool in the player’s inventory teleport them to another place?

1 answer

Log in to vote
0
Answered by 3 years ago

This will teleport the player somewhere when they hold the tool. Put this in a localscript in your tool:

local tool = script.Parent

local playername = game.Players.LocalPlayer.Name

local player = game.Players.LocalPlayer

tool.Equipped:Connect(function()
    print("tool equiped")
    player.Character.PrimaryPart = player.Character.Torso
    player.Character:SetPrimaryPartCFrame(CFrame.new(X,Y,Z))
end)

set x y and z to the position you want

Ad

Answer this question