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

Strange error message, fix?

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

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))

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

1 comment

0

That doesn't work either.

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