Splashsky
|
  |
| Joined: 30 Aug 2008 |
| Total Posts: 1102 |
|
|
| 30 Apr 2014 01:18 PM |
I'm developing a new engine for an RPG, and I'm having a spot of difficulty. The player's stats and such do indeed save... however, they level up to their original level.
What this means is that when a player re-enters, the game sees them as level 1, and ups them to their original level level-by-level. A player is allotted skill points at each level-up, which means that every time the game levels them up, they gain those skill points despite having already spent them.
I need some help figuring out how to fix this. |
|
|
| Report Abuse |
|
|
| 30 Apr 2014 01:33 PM |
DS = game:GetService("DataStoreService"):GetAsync("Level") game.Players.PlayerAdded:connect(function(p) Instance.new("Model", p).Name = "leaderstats" Instance.new("IntValue", p.leaderstats).Name = "Level" wait(1) DS:UpdateAsync(p.userId, function(old) new = old or 0 return new end) wait(1) p.leaderstats.Level = DS:GetAsync(p.userId) end) |
|
|
| Report Abuse |
|