Hi there. I’m trying to create an “ordering system” as one seen as in Bloxburg. However, I’m facing this issue where the second rig in line doesn’t move up, giving room for other rigs to collide in it, which is not what I want, seen as in this gyazo; https://gyazo.com/2f73bf8e5f33d1ded341c5f40bc69840
As you can see, the script doesn’t move up the second rig when first disappears, making it be in the same position as the next rig that comes after.
Providing the code where I think the error lies:
function checkTimer(rigTable, destinationPart, lastTime)
print(unpack(rigTable))
if rigTable[1] then
if not tickStarted then
last = tick()
tickStarted = true
end
if tick() - lastTime >= 5 and rigTable[1] ~= nil then
rigTable[1].Humanoid:MoveTo(workspace.LeavingShop.Position)
rigTable[1]:Destroy()
table.remove(rigTable, 1)
for i, v in pairs(rigTable) do
local targetPos = destinationPart.CFrame * Vector3.new(0, 0, 4 * i)
v.Humanoid:MoveTo(targetPos)
end
if rigTable[1] then
local randomPoint = dictionary[math.random(1, #dictionary)]
local random = unpack(randomPoint)
rigTable[1].Head.BillboardGui.Enabled = true
rigTable[1].Head.BillboardGui.ImageLabel.TextLabel.Text = random
tickStarted = false
last = tick()
else
return
end
end
end
end
game:GetService("RunService").Heartbeat:Connect(function()
checkTimer(rigTableA, workspace.DestinationPart2, last)
end)
function Aftermath(DestinationPoint, rigTable, rigModel, humanoid)
local targetPos = DestinationPoint.CFrame * Vector3.new(0,0,4 * #rigTable)
humanoid:MoveTo(targetPos)
humanoid.MoveToFinished:Wait()
table.insert(rigTable, rigModel)
if rigModel == rigTable[1] then
local randomPoint = dictionary[math.random(1, #dictionary)]
local random = unpack(randomPoint)
rigModel.Head.BillboardGui.Enabled = true
rigModel.Head.BillboardGui.ImageLabel.TextLabel.Text = random
end
end
while true do
wait(1)
local destination = pointTable[math.random(1,#pointTable)]
local pickedPoint = workspace.DestinationPart1
local rigModel = game.ReplicatedStorage.Others.rigmodel:Clone()
local humanoid = rigModel.Humanoid
rigModel.Parent = workspace
humanoid:MoveTo(pickedPoint.Position)
for _, Parts in pairs(rigModel:GetChildren()) do
if Parts:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Parts, "Rigs")
end
end
PhysicsService:CollisionGroupSetCollidable("Rigs", "Players", false)
PhysicsService:CollisionGroupSetCollidable("Rigs", "Rigs", false)
if pickedPoint == workspace.DestinationPart3 then
Aftermath(workspace.DestinationPart4, rigTableB, rigModel, humanoid)
if rigModel == rigTableB[1] then
local lastB = tick()
end
end
if pickedPoint == workspace.DestinationPart1 then
humanoid:MoveTo(workspace.FlatPoint1.Position)
humanoid.MoveToFinished:Wait()
Aftermath(workspace.DestinationPart2, rigTableA, rigModel, humanoid)
if rigModel == rigTableA[1] then
last = tick()
tickStarted = true
end
end
if pickedPoint == workspace.DestinationPart5 then
humanoid:MoveTo(workspace.FlatPoint3.Position)
humanoid.MoveToFinished:Wait()
Aftermath(workspace.DestinationPart6, rigTableC, rigModel, humanoid)
if rigModel == rigTableC[1] then
local lastC = tick()
end
end
end