Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a part teleport to a players current position?

How do I make a script that teleports a part (called part1) to the player's current position?

Here is my current script so far:

function onClicked(hit) 


workspace.part1.Position = Vector3.new()


end

script.Parent.MouseButton1Click:connect(onClicked)

1 comment

0

i changed mine

2 answers

you showed little to no effort in your script so here you go

function onClicked(hit) 


workspace.part1.CFrame = workspace:FindFirstChild(script.Parent.Parent.Parent.Name) -- change this


end

script.Parent.MouseButton1Click:connect(onClicked)

2 comments

0

What should I change inside of the bracket?

0

This shows little to no effort in this script. Try making it simpler.

local PartToTeleport = game.Players.LocalPlayer.Character.HumanoidRootPart
local PartToBring = workspace.Part2

local Offset = CFrame.new(0,1,0)

script.Parent.MouseButton1Click:Connect(function()
       PartToTeleport.CFrame = PartToBring.CFrame * Offset
end)

2 comments

1

How do I make the part go to the player specifically?

0

Oh, player?

This discussion is preserved as it was. New answers, comments, and votes are closed.