|
| 18 Aug 2014 08:10 PM |
game.Players.PlayerAdded:connect(function(player) stats = Instance.new("IntValue", player) stats.Name = "leaderstats" Points = Instance.new("IntValue", leaderstats) Points.Name = "Points" Points.Value = 0 asdf = Instance.new("IntValue", leaderstats) asdf.Name = "Total Points" asdf.Value = 0 end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 08:13 PM |
--Try:
game.Players.PlayerAdded:connect(function(player) stats = Instance.new("IntValue") stats.Name = "leaderstats" Points = Instance.new("IntValue", stats) Points.Name = "Points" Points.Value = 0 asdf = Instance.new("IntValue", stats) asdf.Name = "Total Points" asdf.Value = 0 stats.Parent = player end) |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 08:13 PM |
| output? What do you see? What do you not see? |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 08:18 PM |
| No output and @XX didn't work |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 08:19 PM |
| What do you see? What do you not see? |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 08:21 PM |
| @Pre Nothing, thats why I bothered to reply again |
|
|
| Report Abuse |
|
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 18 Aug 2014 08:21 PM |
You need to let the character load first.
game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character ~= nil stats = Instance.new("IntValue", player) stats.Name = "leaderstats" Points = Instance.new("IntValue", stats) Points.Name = "Points" Points.Value = 0 asdf = Instance.new("IntValue", stats) asdf.Name = "Total Points" asdf.Value = 0 end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 08:30 PM |
I don't understand why mine didn't work.
Where is the script located? |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 08:32 PM |
| I've tried that before, strangely those scripts broke. I used a free model, copy/pasted the source code into another script and the new one didn't work. I'd just find a free model, fresh ones broke for some reason. And yes, I hate using free models too. |
|
|
| Report Abuse |
|
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 18 Aug 2014 08:35 PM |
| What type of script are you using? |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 08:37 PM |
-- I gave it another try, this is how I would do it
function OnEnter(plr)
stats = Instance.new("IntValue") stats.Name = "leaderstats"
p = Instance.new("NumberValue") p.Name = "Points" p.Value = 0 p.Parent = stats
a = Instance.new("NumberValue") a.Name = "Total Points" a.Value = 0 a.Parent = stats
stats.Parent = plr
game.Players.PlayerAdded:connect(OnEnter) |
|
|
| Report Abuse |
|
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 18 Aug 2014 08:37 PM |
Hmm, well then it should be working.
You could try increasing the yield time. I think in the standard roblox leaderboards they wait 5 seconds.
As a side note, I know mine works I tested it before I posted it. So now it's just a matter of why it isn't working for you :D |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 09:27 PM |
game.Players.PlayerAdded:connect(function(player) local stats = Instance.new("Model", player) stats.Name = "leaderstats" local points = Instance.new("IntValue", stats) points.Name = "Points" points.Value = 0 end)
Regular script; place in Workspace. You had the actual stats good, but not the leaderstats object. Add more stats the way you were the ones you had. leaderstats is a Model. Make sure you are using the right value. ie, StringValue, IntValue. Don't know if you can use BoolValue in leaderstats... |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 09:29 PM |
| Xx, that's very inefficient. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Aug 2014 09:39 PM |
| @Xx lol not sayin it's bad, it's just a little bit slower and sloppier. |
|
|
| Report Abuse |
|
|