Garry's Mod

Help

Submitted by Professor_V2, , Thread ID: 240967

Thread Closed
22-04-2022, 01:33 AM
#1
local order = {}
local axis = "y"

for k, v in ipairs(ents.FindByClass("func_movelinear")) do
local p = v:GetPos()[axis]
order[p[axis]] = order[p[axis]] or {}
table.insert(order[p[axis]], v)
end

local sortOrder = {}

for k, _ in pairs(order) do
table.insert(sortOrder, k)
end

table.sort(sortOrder, function(a, b) return a > b end)

for i = 1, #sortOrder do
for k, v in pairs(order[sortOrder[i]]) do
v:Fire("SetSpeed", 200)
v:Fire("SetPosition", (i / #sortOrder))
end
end
Goose#6743 on discord
GooseYT on youtube

Users browsing this thread: 1 Guest(s)