Basically I am trying to make a leaderboard, but here is what I have for it, the problem is it will not show up onto the leaderboard.
local ds=game:GetService("DataStoreService"):GetDataStore("Stats") game.Players.PlayerAdded:connect(function(np) local ls=Instance.new("BoolValue") ls.Name="leaderstats" local level=Instance.new("NumberValue") level.Name="Level" local xp=Instance.new("NumberValue") xp.Name="XP" xp.Parent=ls local kills=Instance.new("NumberValue") kills.Name="Kills" kills.Parent=ls level.Parent=ls ls.Parent=np kills.Value=0 level.Value=0 xp.Value=0 dsl=ds:GetAsync(tostring(np.userid).."Level") if dsl==nil then ds:SetAsync(tostring(np.userid).."Level", 0) else level.Value=ds:GetAsync(tostring(np.Userid).."Level") end dsxp=ds:GetAsync(tostring(np.userid).."XP") if dsxp==nil then ds:SetAsync(tostring(np.userid).."XP", 0) else xp.Value=ds:GetAsync(tostring(userid).."XP") end end) game.Players.PlayerRemoving:connect(function(lp) level=lp.leaderstats.Level ds:SetAsync(tostring(lp.userid).."Level", level.Value) ds:SetAsync(tostring(lp.userid).."XP", xp.Value) end) game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local humanoid=character:WaitForChild("Humanoid") humanoid.Died:connect(function() local value=humanoid:FindFirstChild("creator") local kp=value.Value if kp~=nil then kp.leaderstats.Kills.Value=kp.leaderstats.Kills.Value +1 kp.leaderstats.XP.Value=kp.leaderstats.XP.Value + 10 local xpn=kp.leaderstats.Level.Value * 100 if kp.leaderstats.XP.Value >= xpn then kp.leaderstats.Level.Value=kp.leaderstats.Level.Value +1 ds:SetAsync(tostring(kp.userid).."Level", kp.leaderstats.Level.Value) ds:SetAsync(tostring(kp.userid).."XP", kp.leaderstats.XP.Value) end end end) end) end)
Thank you in advance.
Not everything the humanoid when they die will be a creator value, so you should've kept the code inside the died event the same (unless you found another error inside of it).
That is all I noticed, if I find anything else I'll edit my answer.