1
This commit is contained in:
commit
a85391509d
211 files changed
+28903
No files matched your search
@@ -0,0 +1,14 @@
|
||||
--!strict
|
||||
local CollectionService = game:GetService("CollectionService")
|
||||
local Spawn = {}
|
||||
|
||||
function Spawn.position(world: Instance, attack: boolean, fallback: Vector3, ordinal: number): Vector3
|
||||
local points: {BasePart} = {}
|
||||
for _, point in CollectionService:GetTagged(if attack then "AttackerSpawn" else "DefenderSpawn") do
|
||||
if point:IsA("BasePart") and point:IsDescendantOf(world) then table.insert(points, point) end
|
||||
end
|
||||
if #points > 0 then return points[(ordinal - 1) % #points + 1].Position end
|
||||
return fallback + Vector3.xAxis * ((ordinal - 1) % 5 - 2) * 3 + Vector3.zAxis * (math.floor((ordinal - 1) / 5) * 3)
|
||||
end
|
||||
|
||||
return Spawn
|
||||
Reference in new issue
Block a user