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

error "attempt to call a string value" on line 18?[SOLVED]

Asked by 5 years ago
Edited 5 years ago
01local posthree = {}
02posthree.X = 2
03posthree.Y = 0
04posthree.Z = 0
05 
06local rthree = {}
07rthree.X = 0
08rthree.Y = 0
09rthree.Z = 0
10 
11local x3 = posthree.X
12local y3 = posthree.Y
13local z3 = posthree.Z
14local rx3 = rtree.X
15local ry3 = rtree.Y
16local rz3 = rtree.Z
17 
18local x2 = ((math.cos(math.pi(rx3/180))*x3)  +  (math.sin(math.pi(ry3/180))*x3)  +  (math.sin(math.pi(rz3/180))*x3))

So apperently using math.pi you must use a sign before or after it

1local x2 = ((math.cos(math.pi*((rx3/180))*x3)  +  (math.sin(math.pi*(ry3/180))*x3)  +  (math.sin(math.pi*(rz3/180))*x3))

Answer this question