|
| 17 Dec 2016 07:31 PM |
I have a stage leaderboard and a credits leaderboard, two seperate scripts, and sometimes either one works, but then at the same time, one doesn't.
1st: game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue", player) leaderstats.Name = "leaderstats" leaderstats.Parent=player
local stage = Instance.new("IntValue") stage.Name = "Stage" stage.Value = 0 stage.Parent=leaderstats end)
2nd: game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue", player) leaderstats.Name = "leaderstats" leaderstats.Parent=player local points = Instance.new("IntValue") points.Name = "Credits" points.Value = 0 points.Parent=leaderstats end)
|
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 17 Dec 2016 07:36 PM |
game.Players.PlayerAdded:connect(function(plr)
local leaderstats=Instance.new("Folder") leaderstats.Name="leaderstats" leaderstats.Parent=plr
local stage = Instance.new("IntValue") stage.Name = "Stage" stage.Value = 0 stage.Parent=leaderstats
local points = Instance.new("IntValue") points.Name = "Credits" points.Value = 0 points.Parent=leaderstats
end)
Should work completely fine.. |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 07:36 PM |
i think you should remove the points.Value and stage.Value
intvalue already has a zero for the value so you dont need to put it there
i steal usernames |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 17 Dec 2016 07:39 PM |
| Yeah, by default their value is 0. The game probably also gets confused because you have two "leaderstats". Put it into one. |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Dec 2016 09:29 PM |
probably because the leaderstats are named the same. just combine them duh
|
|
|
| Report Abuse |
|
|
| |
|