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

Script that sets a parts Orientation?

I used this script to set a parts Orientation when it's clicked, but it says "Cframe is not a valid member of part". Why won't this script work?

local clickdetector = game.Workspace.trap.ClickDetector
clickdetector.MouseClick:Connect(function()
	trap.Orientation = CFrame.Angles(0,0,-90)

1 comment

0

Orientation is a Vector3, not a CFrame.

1 answer

✓ Accepted answer

That is because the Orientation property of a Part is not a CFrame. It is a Vector3. Do the same thing you were doing but with Vector3.new() instead of CFrame.Angles()

local clickdetector = game.Workspace.trap.ClickDetector
clickdetector.MouseClick:Connect(function()
    trap.Orientation = Vector3.new(0,0,-90)

Also, I am assuming you have an end to close the Connect?

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