hi, i was making a FFA and when the Caps button is pressed, the players from ur team will be chosen but sometimes i got these errors:
20:01:44.824 - attempt to yield across metamethod/C-call boundary
and:
20:01:44.975 - cannot resume non-suspended coroutine
the script:
function Change()
script.Parent.MainFrame:ClearAllChildren()
for _,Character in ipairs(game.Players:GetChildren()) do
Character = Character.Character
local t,t2 = Character:FindFirstChild('Team'),game.Players.LocalPlayer.Character:FindFirstChild('Team')
if t and t2 then
if t.Value == t2.Value then
local clo = script.Map:Clone()
table.foreachi(clo:GetChildren(),function(_,Child)
Child.Parent = script.Parent.MainFrame
Child.Visible = true
if Child.Name == 'PNameL' then
Child.Text = Character.Name
elseif Child.Name == 'PlayerImage' then
Child.Image = game.Players:GetUserThumbnailAsync(game.Players[Character.Name].UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size180x180)
elseif Child.Name == 'Kills' then
Child.Text = string.format('Kills: %s',Character:WaitForChild('Kills').Value)
end
end)
spawn(function()
clo:Destroy()
end)
clo.Parent = script.Parent.MainFrame
for _,Children in ipairs(clo:GetChildren()) do
if #script.Parent.MainFrame:GetChildren() >= 1 then
for _,Children2 in ipairs(script.Parent.MainFrame:GetChildren()) do
Children.Position = UDim2.new(Children2.Position.X.Scale,Children2.Position.X.Offset - 0.191,Children2.Position.Y.Scale,Children2.Position.Y.OffSet)
end
end
end
end
end
end
end
the error line:
Child.Image = game.Players:GetUserThumbnailAsync(game.Players[Character.Name].UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size180x180)