The npc’s postion/cframe wont change, i set a print command to see if the function runs and it does print which means its something wrong with the cframe, here’s the code.
local newCFrame = CFrame.Angles(0, math.rad(90), 0)
local function teleport()
print("FunctionRun")
script.Parent.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-5.263, 4.82, -67.364)) * newCFrame
end
game.Workspace.Value1.Changed:Connect(teleport)```
local newCFrame = CFrame.Angles(0, math.rad(90), 0)
local function teleport()
print("FunctionRun")
script.Parent.UpperTorso.CFrame = CFrame.new(Vector3.new(-5.263, 4.82, -67.364)) * newCFrame
end
game.Workspace.Value1.Changed:Connect(teleport)
local newCFrame = CFrame.Angles(0, math.rad(90), 0)
local function teleport()
print("FunctionRun")
script.Parent:PivotTo(CFrame.new(-5.263, 4.82, -67.364) * newCFrame)
end
game.Workspace.Value1.Changed:Connect(teleport)
Yes it works, but for future work use PivotTo. The Roblox API changes all the time, and for good reason. When a newer and better API/Approach is available, don’t stick around with the old ones.
I’m not sure about R15, but I’m very certain that modifying the HumanoidRootPart.CFrame in R6 moves every part of the character, because all Motor6ds connect to hrp.