So here I have a loop which spawn 6 blocks on top of a player inside a loop containing all players, but as you can see it switches from one player to the other obviously. I wanna make both loops run on both players at the same time (server sided), does anyone know how to go about this? (Wildly alternative code is appreciated too.)
function dropBlock()
findHRP() -- Basically just finds all HumanoidRootParts in-game, so the game can actively get their current positions every time loop runs by
if #ActiveRootTable == 0 then return end
isRunning = true
for _,HumanoidRootPart in pairs(ActiveRootTable) do
for i = 0,5,1 do
local block = Instance.new("Part")
block.Position = HumanoidRootPart.Position + Vector3.new(0,8,0)
block.Parent = workspace
debris:AddItem(block, 3)
task.wait(1)
end
end
isRunning = false
end
while task.wait(1) do
if isRunning == false then
dropBlock()
end
end