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

difference between these two methods?

Asked by 1 year ago
local part = game.Workspace:FindFirstChild("Spawn")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(chr)
        local hrp = chr:FindFirstChild("HumanoidRootPart")
        hrp:PivotTo(part.CFrame)
    end)
end)

here's the code the method is being used on

hrp:PivotTo(part.CFrame)
chr:PivotTo(part.CFrame)

my question is what's the difference between these two? which one's better to use? they both do the same thing in my testing

1 answer

Log in to vote
0
Answered by 1 year ago

I don't think there's a difference. If you're teleporting a player, an npc, or a model, you definitely use Model:PivotTo(). But if you're teleporting a specific part, you use Part:PivotTo().

0
alr preciate u bro ZeroToH3ro 82 — 1y
Ad

Answer this question