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: How to check if a player has data?

Previous Thread :: Next Thread 
Ferseus is not online. Ferseus
Joined: 23 May 2013
Total Posts: 247
19 Dec 2013 03:07 PM
local d = Player:LoadNumber("Saved Data")
if d then
--Script

Will that work? Im trying to make it check if the player has saved any data.
Report Abuse
Quorum is not online. Quorum
Joined: 25 Oct 2013
Total Posts: 4680
19 Dec 2013 03:09 PM
No. If the key doesn't exist it will return '0', not false.
Report Abuse
Ferseus is not online. Ferseus
Joined: 23 May 2013
Total Posts: 247
19 Dec 2013 03:19 PM
Well how would I do it then?
Report Abuse
Quorum is not online. Quorum
Joined: 25 Oct 2013
Total Posts: 4680
19 Dec 2013 03:25 PM
Check to see if the value is equal to zero...? If it is, and if it shouldn't be at any point in your game, then do what you want to do with it.
Report Abuse
Ferseus is not online. Ferseus
Joined: 23 May 2013
Total Posts: 247
19 Dec 2013 03:41 PM
Well then what if I saved an instance and I wanted to check if a player saved that instance?
Report Abuse
MXrcr20 is not online. MXrcr20
Joined: 01 Oct 2008
Total Posts: 2644
19 Dec 2013 03:43 PM
if Player:LoadNumber("Saved Data") ~= 0 then
--stuff
end
Report Abuse
Quorum is not online. Quorum
Joined: 25 Oct 2013
Total Posts: 4680
19 Dec 2013 03:44 PM
@Fer,
In the case of LoadInstance it will return nil if the 'key' you're using doesn't exist for that place.
Report Abuse
Ferseus is not online. Ferseus
Joined: 23 May 2013
Total Posts: 247
19 Dec 2013 03:46 PM
Im trying to check if the player has ever saved so the load script im making doesnt glitch if the player doesnt have any data! Sorry for all the pressure, data persistence is just the hardest scripting for me
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