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 » Scripters
Home Search
 

Re: Datastore :WaitForPlayer() problem

Previous Thread :: Next Thread 
freerobux456 is not online. freerobux456
Joined: 25 Feb 2010
Total Posts: 244
27 Jan 2015 04:18 PM
when i start my game the following script errors

http://codepad.org/stzh6Zfe

the error is
14:15:08.338 - WaitForReady is not a valid member of Player
14:15:08.339 - Script 'ServerScriptService.data', Line 5

please help?
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
27 Jan 2015 04:19 PM
It's only necessary to call Player:WaitForDataReady() if you are using Data Persistence. You aren't, you're using Data Stores so the call is unecessary.
Report Abuse
freerobux456 is not online. freerobux456
Joined: 25 Feb 2010
Total Posts: 244
27 Jan 2015 04:19 PM
*WaitForReady()
Report Abuse
cycoboy83 is not online. cycoboy83
Joined: 31 May 2011
Total Posts: 831
27 Jan 2015 04:19 PM
It's WaitForDataReady, not WaitForReady
Report Abuse
freerobux456 is not online. freerobux456
Joined: 25 Feb 2010
Total Posts: 244
27 Jan 2015 04:20 PM
gonna try brb
Report Abuse
freerobux456 is not online. freerobux456
Joined: 25 Feb 2010
Total Posts: 244
27 Jan 2015 04:24 PM
it now errors

14:24:44.896 - ServerScriptService.data:23: attempt to index field '?' (a nil value)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
27 Jan 2015 04:33 PM
:WaitForDataReady() is for data persistence not data stores
Report Abuse
BrickConnector is not online. BrickConnector
Joined: 10 Sep 2011
Total Posts: 3437
27 Jan 2015 04:37 PM
WaitForDataReady is for persistence not stores as above said.
Report Abuse
freerobux456 is not online. freerobux456
Joined: 25 Feb 2010
Total Posts: 244
27 Jan 2015 08:59 PM
well i removed it and got this
14:24:44.896 - ServerScriptService.data:23: attempt to index field '?' (a nil value)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Jan 2015 09:04 PM
You should learn to debug yourself.

"local stats2 = np:FindFirstChild("leaderstats"):GetChildren()
if stats2 then"

Remove the check, since it does nothing for you.

local stats2 = np.leaderstats:GetChildren()
for i=0, #stats2 do
stats2[i].Value = datastore:GetAsync(stats2[i].Name)
end



You shouldn't be getting DataStores that much. I recommend you just save a table to the DataStore instead, so you don't need to repeatedly get data.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Jan 2015 09:05 PM
And your problem is, Lua tables are not 0-based. They are 1-based tables.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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