Hellur, so I have a simple for loop inside of a local function that should run but does not. Either something is really wrong or I just broke it some way. The output does not give any error, the function just does not run past line 39.
Server script: Please ignore the prints. I know there is like 3 types I used.
local Scan = {'G17'} local Status = script.Parent.Parent.Parent.Parent.Status local Label = script:WaitForChild("Example") local Scanner = script.Parent.Parent.Parent.Parent:GetChildren() local Detector = script.Parent.Parent.Parent.Parent.Regoin function CallRegion(Area) print(Area) local upVal1 = Area.Position - (Area.Size/2) local upVal2 = Area.Position + (Area.Size/2) print(upVal1, upVal2) return Region3.new(upVal1, upVal2) end local function LocatePlayers(Area) print 'Called' for _,v in pairs(Status.Text.Frame:GetChildren()) do if v.Name == "Player" then game:GetService("Debris"):AddItem(v, .1) end end print'20' local Region = CallRegion(Area) local GetParts = workspace:FindPartsInRegion3(Region, nil, math.huge) local Players = {} print'24' for _,v in pairs(GetParts) do local Player = game.Players:GetPlayerFromCharacter(v.Parent) if Player then for i,_ in pairs(Players) do if not Players[i].Name == Player.Name then table.insert(Players, Player) print 'Ye boiiiiiiiszzxxx.' for q,n in pairs(Players) do print(Players[q]) end end end end end print'37' for i,_ in pairs(Players) do print'Checking...' for _,tools in pairs(Scan) do if Players[i].Backpack:FindFirstChild(tools) then print 'Oof. I got that unarmed thing wrong.' --[[local Clone = Label:Clone() local Name = string.upper(v.Name) Clone.Text = Name.." - [ARMED]" Clone.TextColor = Color3.fromRGB(250, 36, 21) Clone.Name = "Player" Clone.Parent = Status.Text.Frame]] else --[[local Clone = Label:Clone() local Name = string.upper(v.Name) Clone.Text = Name.." - [UNARMED]" Clone.Name = "Player" Clone.Parent = Status.Text.Frame]] print 'Someone is armed!' end end end print'61' return Players end script.Parent.MouseClick:Connect(function(Player) if Player.TeamColor ~= BrickColor.new("Dark stone grey") then return else LocatePlayers(Detector) end end)