generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: True Persistent Persistence (Leaderstats)

Previous Thread :: Next Thread 
Splashsky is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image