So i have been trying to add a stringvalue so you get a rank the more money you have in-game
But it doesnt work. All off the IntValues Will show but not the StringValue is there any way to fix this?
game.Players.PlayerAdded:Connect(function(p)
local stats = Instance.new(“IntValue”, p)
stats.Name = “leaderstats”
local money = Instance.new("IntValue", stats)
money.Name = "Money"
money.Value = 50
local Resources = Instance.new("IntValue", stats)
Resources.Name = "Wheat"
Resources.Value = 0
local Research = Instance.new("IntValue", stats)
Research.Name = "Carrot"
Research.Value = 0
local Research = Instance.new("IntValue", stats)
Research.Name = "CC"
Research.Value = 0
local rank = Instance.new('StringValue', stats)
rank.Name = 'Rank'
rank.Value = 'Guest'
I’m guessing that there are probably too many stats on the leaderboard at this point and the one with the stringvalue just happens to not render because of this.
I see that the parent of the StringValue is not yet been set. You need to make a folder in the player called ‘leaderstats’ you then need to parent all things you want on the leaderboard to that folder.
He was using the second parameter of Instance.new to set the parent, which I suppose does the same job but @Frepzter might want to consider setting the parent after all of the properties have been set. See this article.