While working on this round system script I’ve run into an error invalid argument #1 to ‘ipairs’ (table expected, got instance) but it shouldn’t be able to even grab an instance?
local Script = script.Parent
local timer = 45
local roundInProgress = false
local Players = game:GetService("Players")
local storage = game:GetService("ReplicatedStorage")
local status = storage.RoundStatus
local Monster = require(game.ServerScriptService.MonsterModule)
local Human = require(game.ServerScriptService.HumanModule)
local Teams = game:GetService("Teams")
local SStorage = game:GetService("ServerStorage")
local Queue = workspace.lobby["Monster Queue"].Queue
while true do
if timer >= 0 and not roundInProgress then
repeat
status.Value = timer
timer -= 1
task.wait(1)
until timer < 0
roundInProgress = true
local Active = Queue:FindFirstChildWhichIsA("TextLabel").Name
for _, v in ipairs(game:GetService("Players")) do
if v.Name == Active then
print(Active)
end
end
timer = 10
task.wait(1)
elseif timer >= 0 and roundInProgress then
repeat
status.Value = timer
timer -= 1
task.wait(1)
until timer < 0
roundInProgress = false
status.Value = "Fight Ended"
timer = 45
task.wait(1)
end
end