This script doesn't seem to be putting players into random spots in the image labels. See this link below to see some of the info about it already:
but I have the gui check if it can find the other players leader gui first so it can not error and error if needed but when its all good and everything, the script only puts 1 person in one spot and doesnt put any other player in. Can someone help me?
script.Parent.Changed:connect(function()
if script.Parent.Value == true then
print("GreenKingGui On")
local lk = game.Players:GetChildren()
for k = 1, #lk do
if lk[k]:FindFirstChild("King") and lk[k].TeamColor == BrickColor.new("Bright blue") and lk[k].PlayerGui:FindFirstChild("BlueKingGui") then
print("Found Blue")
elseif lk[k].PlayerGui:FindFirstChild("BlueKingGui") ~= nil then
print("Error in gkg yesno")
wait(1)
game.Workspace:FindFirstChild("Round1").Er.Value = 2
end
--end
--end
script.Parent.Parent.BackFrame.Visible = true
print("Putting random slots for green")
wait(0.2)
local labels={[1] = script.Parent.Parent.BackFrame.Frame.PlayerSpot}
local count=1
wait(0.5)
for _,v in pairs(game.Players:GetPlayers())do
if v.TeamColor==BrickColor.new("Bright green")and labels[count]then
labels[count].PName.PlayName.Value=v.Name
table.insert(labels,count,v.Name)
count=count+1
print("Done putting slots for green")
end
end
end
elseif script.Parent.Value == false then
print("GreenKingGui Off")
script.Parent.Parent.BackFrame.Visible = false
local l = script.Parent.Parent.BackFrame.Frame:GetChildren()
for k = 1, #l do
l[k].Name = "PlayerSpot"
end
end
--end
--end
end)

1 comment
could you put that in the script for me? I often have a hard time knowing where to put it in the script, because I know it should probably be in a specific spot?