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

Arithmetic error problem?

Asked by 10 years ago

OK, I have this script that calculates the area of a circle from values. Script:

P = 3.141592653
R = script.Parent.Parent.Radi 


function CalculateArea()
print'starting'
wait()
A = (P * R)
wait()
A2 = A*A
print'calculated'
print (A2)
end

script.Parent.ClickDetector.MouseClick:connect(CalculateArea)

-- Output : Workspace.Model.E.Script:9: attempt to perform arithmetic on global 'R' (a userdata value)

Not too sure what it means?

0
R is a roblox instance. The equivalent of that operation could also be 1 +game.Workspace, which of course is something Lua cannot calculate. What is "R"? Is it a NumberValue? In that case, R = script.Parent.Parent.Radi.Value jobro13 980 — 10y
0
Ah thanks, simple thing I seemed to have missed. Wolfanger 0 — 10y

Answer this question