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

Click > ROTATION?

function Clicked()
	script.Parent.Parent.CFrame = CFrame.new(-44.4, 5.39,2) *CFrame.Angles(script.Parent.CFrame.r+Vector3.new(3,3,3)
	end
	script.Parent.ClickDetector.Clicked:connect(Clicked)

The 'end' part is apparently wrong.

2 answers

✓ Accepted answer

There is a missing bracket. Also the event is wrong. Fixed:

function Clicked()
	script.Parent.Parent.CFrame = script.Parent.Parent.CFrame *CFrame.Angles(math.rad(3), math.rad(3), math.rad(3))
end
script.Parent.ClickDetector.MouseClick:connect(Clicked)

Edit: Fixed up your CFrame stuff too.

Edit2: Ugh, I guess Angles doesn't approove Vector3's.

4 comments

0

It says 'r' isn't valid.

0

Fixed up your CFrame stuff too.

0

It's still not working! It says in output: Workspace.Part.Part.Script:31: bad argument #3 to 'Angles' (number expected, got no value)

0

Edit2: Ugh, I guess Angles doesn't approove Vector3's.

function Clicked()
    script.Parent.Parent.CFrame = CFrame.new(-44.4, 5.39,2) *CFrame.Angles(script.Parent.CFrame.r+Vector3.new(3,3,3))
end
script.Parent.ClickDetector.MouseClick:connect(Clicked)

The end wasn't wrong, you were just missing a parenthesis.

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