Will this work?
distances = {}
for key,value in ipairs(beacons) do
for i,unit in ipairs(spawned units)
local distance = math.sqrt((unit.x-k.x)^2 + (unit.y-k.y)^2
table.insert(distances,distance)
end
table.sort(distances)
Then pick the last one?
Lighters pause in midpoints
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 15
- Joined: Sat Aug 19, 2017 9:13 am
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests