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

Strange error message, fix?

Asked by
Exsius 162
9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Players.Player1.Backpack.UMP3.Gun.LocalScript:78: bad argument #3 to 'Angles' (number expected, got no value)

Which is strange considering if you print rotation of a part you get the rotation of it.

model.PrimaryPart = model.RArm

R = script.Parent.Rotation
F = model.PrimaryPart.CFrame.p --Vector3.new(fx,fy,fz)

local NEWPOS = F:Lerp( Final,smooth)

model:SetPrimaryPartCFrame(CFrame.new(NEWPOS) * CFrame.Angles (R))



end

end)

Thanks,

Exsius.

2 answers

Log in to vote
1
Answered by 9 years ago

Like alessandro said, the Rotation property contains a Vector3. However, to get it working for your script, you need to use the x, y and z properties of a Vector3 to get a number.

model:SetPrimaryPartCFrame(CFrame.new(NEWPOS) * CFrame.Angles(R.x,R.y,R.z))
Ad
Log in to vote
-1
Answered by 9 years ago

The property "Rotation" return a Vector3 not a CFrame, try to use CFrame.Angles(Vector3.new(R)) instead!

0
That doesn't work either. Exsius 162 — 9y

Answer this question