Hi so I am new to this Scripting stuff and I don't know how to add another stat along with one on my leaderstats. Here is what I tried to do,
> function onPlayerEntered(newPlayer) wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local score = Instance.new("IntValue") score.Name = "Sips" score.Value = 0 score.Parent = stats stats.Parent = newPlayer end function onPlayerEntered(newPlayer) wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local score = Instance.new("IntValue") score.Name = "Cash" score.Value = 0 score.Parent = stats stats.Parent = newPlayer end game.Players.ChildAdded:connect(onPlayerEntered)
The thing that you did is forget to name the variables differently. If you do that, you will only have 1 stat on leaderstats. This is something that would work:
local sips = Instance.new("IntValue") score.Name = "Sips" score.Value = 0 score.Parent = stats stats.Parent = newPlayer
local cash = Instance.new("IntValue") score.Name = "Cash" score.Value = 0 score.Parent = stats stats.Parent = newPlayer
What you have to do is the following code:
game.Players.PlayerAdded:connect(function(p) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Parent = p local money = Instance.new("IntValue") money.Name = "Money" -- Change "Money" to anything you want to name it like "Cash" money.Value = 50 -- Change the value to how many you want when the player joins the game money.Parent = stats local Whatever = Instance.new("IntValue") Whatever.Name = "Whatever" -- Change "Whatever" to anything you want to name it like "Cash" Whatever.Value = 50 -- Change the value to how many you want when the player joins the game Whatever.Parent = stats end)