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

My part in roblox wont tp to the character?

Asked by 4 years ago

Hey so I want to try and make this part TP to the character this is what I have and it's not working.

script.Parent.MouseButton1Click:Connect(function()

    local user = script.Parent.Parent.Parent.Parent.PlrName_Money
    local jail = game.Workspace.j
    local plr = game.Players:FindFirstChild(user.Text)

    game.Workspace.j.Position = Vector3.new(plr.character.HumanoidRootPart.Position)

end)

2 answers

Log in to vote
0
Answered by 4 years ago
game.Workspace.j.CFrame= CFrame.new(plr.character.HumanoidRootPart.Position)
0
Thanks! Darthman522 10 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
script.Parent.MouseButton1Click:Connect(function(plr)

    game.Workspace.j.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position)--only need to reference the part once and we use cframe to change position of parts

end)

make it a clickdetector since they know which player has clicked

Answer this question