Alright, this is supposed to go get a value in a gui in all players, and set it in a table, then go through the table and take out every number except the highest number, and then clone the players head with the highest number, righ now its either not removing the numbers from the table or my logic is wrong, the updated version of the code has been edited on this please help
numtble = {}
function Check()
repeat wait() until game.Players.NumPlayers >= 2
for i,v in pairs(game.Players:GetPlayers()) do
table.insert(numtble,v.PlayerGui.Points.Posy.Numbers.Value)
wait()
print("Awesome2")
wait()
end
end
function Check2()
for i=1, #numtble do
if i > 2 then
if numtble[i] > numtble[i] - i then
dum = numtble[i] - 1
table.remove(numtble,dum)
elseif numtble[i] < numtble[i] - i then
table.remove(numtble,numtble[i])
wait()
print("Awesome")
wait()
end
end
end
end
function Winner()
Check()
Check2()
for i,v in pairs(game.Players:GetPlayers()) do
if v.PlayerGui:findFirstChild("Points"):findFirstChild("Posy"):findFirstChild("Numbers").Value == numtble[1] then
v.Character.Head:Clone().Parent = game.Workspace
wait()
end
end
end
Winner()
