Hey there, so I have a rather odd error that should not be happening in the current context.
The error is: Attempt to get length of an instance value
This is my code:
RunService.Heartbeat:Connect(function()
for i, v in pairs(Queue:GetChildren()) do
if #v == 2 then
for i, s in pairs(Spawns:GetChildren()) do
s.Name = v.Name
local player = workspace:FindFirstChild(v.Name)
local pObj = game.Players:GetPlayerFromCharacter(player)
if player then
if Spawns:FindFirstChild(player.Name) then
player.PrimaryPart.CFrame = Spawns:FindFirstChild(player.Name).CFrame
player.Humanoid.WalkSpeed = 0
pObj.InQueue.Value = false
else
warn("No spawn named: ".. player.Name)
end
else
warn("No player detected with the name of: ".. player.Name)
end
for x = 5,1,-1 do
Countdown.Value = i
wait(1)
end
player.Humanoid.WalkSpeed = 16
pObj.InQueue.Value = false
Queue:FindFirstChild(player.Name:Destroy())
end
else
warn("Not equal to 2")
end
end
end)
If you know what is going on, please don’t hesitate to tell me! Thanks!