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

Click > ROTATION?

Asked by 10 years ago
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

Log in to vote
0
Answered by 10 years ago

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.

0
It says 'r' isn't valid. DDDropTheBase 0 — 10y
0
Fixed up your CFrame stuff too. ZarsBranchkin 885 — 10y
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) DDDropTheBase 0 — 10y
0
Edit2: Ugh, I guess Angles doesn't approove Vector3's. ZarsBranchkin 885 — 10y
Ad
Log in to vote
0
Answered by
jav2612 180
10 years ago
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.

Answer this question