trying to make a score leaderboard and I get this error i modified a kills and death leaderboard online, so thats how i got this code.
game.Players.PlayerAdded:connect(function(plr) local leaderstats = Instance.new("IntValue",plr) leaderstats.Name = "leaderstats" -- dont change the name or else it will not work! local Death = Instance.new("IntValue") Death.Name = script.DeathsName.Value -- The Value with be in the script local Kills = Instance.new("IntValue") Kills.Name = script.KillsName.Value -- The Value with be in the script local score = Instance.new("IntValue") score.Name = "Score" score.Parent = leaderstats plr.leaderstats.score.Value = Kills * 10 - Death * 5 end)
may someone help me with this code?
On line 14, instead of:
plr.leaderstats.score.Value
try typing:
plr.leaderstats.Score.Value
This errored because you set the name of the score variable to "Score", but went on to use the lowercase "score". When referencing objects always use the name of the object.