Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

a couple of things are not working with my leaderboard please help me?

Im currently trying to make a basic leaderboard that displays name, kills and deaths. the text there is controlled by the leaderstats values but it worked for a little bit but now it keeps giving me and error that says, leaderstats is not part of the player but when i go check in the explorer tab i have the leaderstats loaded into the player.

Another issue is i want the text to update with the amounts of deaths or kills but the way i do it, im not sure how to have it update. Can you please help me out with this -TeaWithMee

Leaderboard code

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local clone = game.StarterGui.LeaderBoard.RedList.Listin:Clone()
		local parent = game.StarterGui.LeaderBoard.RedList
		clone.Parent = parent
		clone.PlrName.Text = plr.Name
		clone.Kills.Text = plr.leaderstats.Kills.Value
	clone.Deaths.Text = plr.leaderstats.Deaths.Value
	end)
end)

2 comments

0

can you show code that creates the leaderstats?

0

Why don't you just add this part to the code that creates your leaderstats? When the player joins the game set the values of your leaderboard in the same part.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.