function RandomCircleSpawnCoords(x,y,r,fl)
if x and y and r then
if not fl then
flooor = GROUND
end
local t = {}
local n = 1
x = x-r
y = y-r
r = r+r
for i = x, r do
print(i)
for j = y, r do
print(j)
if (i - x)*(i - x) + (j - y)*(j - y) <= r*r then
t[n] = {x1, y1, flooor}
n = n + 1
end
end
end
print('Array: ', t)
print('Length: ', length(t))
local c = t[random(length(t))+1]
return c[1], c[2], c[3]
end
end
RCSC = RandomCircleSpawnCoords
The array 't' is not being populated, and the loops for 'i' and 'j' are not running at all. What could be the problem?
RCSC = RandomCircleSpawnCoordsIs that line written exactly like that, or did you copy it incompletely? If it's written that way, then it's obvious why it's not working.)