This is my function
function loop (frames) for i = 1,frames do whead.C0 = CFrame.Angles(math.rad(dh[1]/frames + h[1]),math.rad(dh[2]/frames +h[2]),math.rad(dh[3]/frames +h[3])) end end loop(10)
I get this error on line 4 "attempt to perform arithmetic on field '?' (a nil value)" dh and h are tables with 3 number values( Hence the brackets [] ), frames is also a number value.
dh and h are originally 0 dh is the difference, h is the current rotation the empty dh and h are passed through a function giving it a value. But it they both start off as
h = {} dh = {} --then they go through this function which sets the variable in the table's value function differences(new,current,difference) difference = new-current end --so it would be differences(new**(which doesn't pertain to this problem)**,h[1],dh[] )