So I tested my script out and it only ran once and then the next person who joined it didn't run. I suspect its an error, but I can not find it no matter how many times i look through it. Maybe one of you can? Here is the script:
for i = 1, leader.MaxPlayers.Value do local x = Instance.new("TextLabel") x.Parent = leader.Players x.Name = "Player" .. i .. "L" x.Size = UDim2.new(0, 120, 0, 10) x.FontSize = "Size14" x.TextColor3 = Color3.new(color) x.BackgroundTransparency = 1 x.BorderSizePixel = 0 x.Position = UDim2.new(0, 50, 0, 50) + UDim2.new(0, 0, 0, 20*i) x.Visible = false -------------------- LABELS MADE ------------------------------ local w = Instance.new("StringValue") w.Parent = leader.Players w.Name = "Player" .. i table.insert(playerlist, x) table.insert(playervalue, w) end game.Players.PlayerAdded:connect(function(plr) for i, v in pairs(playervalue) do if adding == false then if v.Value == "" then v.Value = plr.Name print("Player Added") adding = true end end end adding = false if Stats == true then game.StarterGui.Leaderboard.Stats2.Value = true local starterstats = Instance.new("Model") if StatsName ~= "" then starterstats.Name = StatsName starterstats.Parent = plr end if Stat1 ~= "" then local firststat = Instance.new(Stat1Type) firststat.Parent = starterstats firststat.Value = Stat1Value firststat.Name = Stat1 end if Stat2 ~= "" then local secondstat = Instance.new(Stat2Type) secondstat.Parent = starterstats secondstat.Value = Stat2Value secondstat.Name = Stat2 end if Stat3 ~= "" then local thirdstat = Instance.new(Stat3Type) thirdstat.Parent = starterstats thirdstat.Value = Stat3Value thirdstat.Name = Stat3 end game.Players.PlayerAdded:connect(function(plr) for i, v in pairs(playervalue) do if adding == false then if v.Value == "" then v.Value = plr.Name print("Player Added") adding = true end end end adding = false if Stats == true then game.StarterGui.Leaderboard.Stats2.Value = true local starterstats = Instance.new("Model") if StatsName ~= "" then starterstats.Name = StatsName starterstats.Parent = plr end if Stat1 ~= "" then local firststat = Instance.new(Stat1Type) firststat.Parent = starterstats firststat.Value = Stat1Value firststat.Name = Stat1 end if Stat2 ~= "" then local secondstat = Instance.new(Stat2Type) secondstat.Parent = starterstats secondstat.Value = Stat2Value secondstat.Name = Stat2 end if Stat3 ~= "" then local thirdstat = Instance.new(Stat3Type) thirdstat.Parent = starterstats thirdstat.Value = Stat3Value thirdstat.Name = Stat3 end
You're using :connect(function() wich means it doesnt stop on END, it stops at END) replace the last end with end) (didnt read full trough, but i didnt see any end) and you're supposed to put them after :connect(function() )