You are using the script.Parent.CFrame = CFrame.new(-150, 0, 267) statement correctly.
There could be multiple reasons for this behavior.
- It could be a BodyMover object inside of the part.
- Another script intentionally or unintentionally rotating the object.
- It could be a Roblox based glitch or corrupted chunk of code.
You could try recreating the place with only the objects you want (make sure there are no hidden or unwanted Scripts of any kind). The easiest way to do this would be to open a new place and copy the objects you want.
The following block of code should help find any unwanted scripts if any exist (it will print the path to all scripts in the game):
local function printScripts(parent)
for _, v in ipairs(parent:GetChildren()) do
if v:IsA"Script" then
print(v:GetFullName())
end
printScripts(v)
end
end
printScripts(game)
Keep in mind that this will not include CoreScripts and StarterScripts.
If for some reason no objects are effecting this part. Try setting up a test place with only the bare minimum to see if you can recreate this behavior. If it still happens, contact Roblox to report a bug report.
2 comments
Are you completely sure this is the correct position?
Yeah. I found out my brick is rotated by 90 degrees. I can't use Rotation and vector3 to change it back because it would collide with bricks. Can I use some CFrame to rotate it? CFrame.Angles(0,90,0)