Can someone kindly explain to me why this code:
local coordinate = {}
local function gridPositions(number, offsetDown)
if number \<= 4 and offsetDown \<= 2 then
local pointx = (85 \* number) + 31
local pointy = (85 \* offsetDown) + 53
coordinate = {pointx, pointy}
else
print "Off of grid"
end
end
produces a Runtime Error “attempt to compare nil with number”
I think it has something to do with my offsetDown value, but I don’t know why. When I try to set up my function as:
local function gridPositions(number = 0, offsetDown = 0)
I get a Runtime error “error loading module” and the app crashes. What’s going on? [import]uid: 47235 topic_id: 20757 reply_id: 320757[/import]