Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 06:59 PM |
Would this work?
game.Players.PlayerAdded:connect(function(player) player:WaitForDataReady() leaderstats = Instance.new("Model",player) leaderstats.Name = "Leaderstats" experience = Instance.new("IntValue",player) experience.Name = "Experience" experience.Value = player:LoadNumber("Experience") end)
game.Players.PlayerRemoving:connect(function(player) if player.DataReady then player:SaveNumber("Experience",player.Leaderstats.Experience.Value) end end)
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 22 Aug 2013 07:02 PM |
| Doesn't leaderstats have to be lowercase? |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 07:15 PM |
It doesnt create the leaderstats
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 07:18 PM |
@cnt I dont want it to create a leaderboard
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 22 Aug 2013 07:18 PM |
Whoops, I missed an error, change the experience line to this: experience = Instance.new("IntValue", player.Leaderstats)
@cnt, I think you can name the parent stat whatever you want. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 22 Aug 2013 07:18 PM |
| I thought he wanted it on the Roblox leaderboard c: |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 07:19 PM |
This is my script, I didnt even bother with creating the leaderstats Instance. Its only a value for a GUI game.Players.PlayerAdded:connect(function(player) player:WaitForDataReady() experience = Instance.new("IntValue",player) experience.Name = "Experience" experience.Value = player:LoadNumber("Experience") end)
game.Players.PlayerRemoving:connect(function(player) if player.DataReady then player:SaveNumber("Experience",player..Experience.Value) end end)
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 22 Aug 2013 07:19 PM |
| Oh, you don't? Well then I don't think you need that 'Leaderstats' model. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 22 Aug 2013 07:20 PM |
| player:SaveNumber("Experience",player.Experience.Value) |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 07:26 PM |
Its not instancing the values into player
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Aug 2013 07:31 PM |
Im testing it in start server>start player
Age of War Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110676051] Working on classes |
|
|
| Report Abuse |
|
|