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

How do I get it so my GUI will display the leaderboard stats?

Here's what I've got so far..

game.Players.PlayerAdded:connect(function(player)
	local leaderstats = Instance.new("Model",player) --This is putting the leaderboard into each player
	leaderstats.Name = "leaderstats" --Naming the leaderboard
	
	local kills = Instance.new("IntValue", leaderstats)
	kills.Name = "Kills"
	kills.Value = 0
	
	local credits = Instance.new("IntValue", leaderstats)
	credits.Name = "Credits"
	credits.Value = 10
	
	local K = game.StarterGui.Leaderboard.Frame.Kills1
	local C = game.StarterGui.Leaderboard.Frame.Credits1
end)

wait(0)
K.Text = "Kills:" + kills.Value
C.Text = "Credits:" + credits.Value

1 answer

✓ Accepted answer

Your problem is on lines 18 and 19. Replace those two lines with this:

K.Text = "Kills: "..kills.Value --Using "+" only works when adding 2 numbers.
C.Text = "Credits: "..credits.Value

The "..kills.Value" makes it so that it will make the K and C.Text the value that the kills currently are by adding it to the string

Hope I helped!

1 comment

0

I had to do some adjusting, and recreate some scripts and put them as a child under GUI's..But without your help I couldn't have done it. Thank you(:

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