Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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!

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(: frogfriend99 10 — 9y
Ad

Answer this question