I have conducted multiple tests [In Online, and in Solo mode], but it keeps saying Workspace.LeaderBoard:17: attempt to index field 'Character' (a nil value), I have changed a few things in that part of the script, but it still keeps erroring, and I don't know what I'm supposed to do to fix it, because, as said before, I've conducted multiple tests to try and get it to work, here is the script;
local Admins = {"TheeDeathCaster","XAdminCommandsX","Kohltaphae","TheeFlameDoge","DeathWindZombie","Player1"}
print(#Admins.." users in list.")
local function ChkAdmin(plr,str)
for i = 1, #Admins do if plr:lower() == Admins[i]:lower() then return true end end
return false
end
local function onDeath(plr)
coroutine.wrap(function()
repeat wait() until plr
end)()
repeat wait() until plr:FindFirstChild("leaderstats") and #plr.leaderstats:GetChildren() > 0 and plr.Character and #plr.Character:GetChildren() > 0
repeat wait() until plr and plr.Character and plr.Character:FindFirstChild("Humanoid")
plr.Character.Humanoid.Changed:connect(function()
if plr.Character.Humanoid.Health <= 0 then
repeat wait() until plr.leaderstats:FindFirstChild("Deaths")
plr.leaderstats.Deaths.Value = plr.leaderstats.Deaths.Value + 1
end
end)
end
local function LeaderStats(plr)
local LeaderStat = Instance.new("IntValue",plr)
LeaderStat.Name = "leaderstats"
local Level = Instance.new("IntValue",LeaderStat)
Level.Name = "Level"
Level.Value = 0
local Deaths = Instance.new("IntValue",LeaderStat)
Deaths.Name = "Deaths"
Deaths.Value = 0
local Experience = Instance.new("IntValue",LeaderStat)
Experience.Name = "Exp"
Experience.Value = 0
local Money = Instance.new("IntValue",LeaderStat)
Money.Name = "Money"
Money.Value = 5
onDeath(plr)
if ChkAdmin(plr.Name,false) then
Level.Name = "Admin"
Level.Value = 1337
Money.Value = 9000
end
print(plr.Name.." has joined the server.")
end
game.Players.PlayerAdded:connect(LeaderStats)
for i,v in pairs(game.Players:GetPlayers()) do LeaderStats(v) end

4 comments
So, 'repeat until nil' loops aren't very good to use? :o
They're not great.
I have a question, how are 'repeat until nil' loops bad to use? I'm just a bit curious. :o
Because you're running the code in the loop at least 30 times a second.