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: can I have two datastores in the same game??

Previous Thread :: Next Thread 
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 12:56 PM
b


R$2,673
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 12:57 PM
was wondering this because I added another datastore and my game is acting weird


R$2,673
Report Abuse
Fragility is not online. Fragility
Joined: 12 Mar 2011
Total Posts: 483
27 Jan 2015 12:57 PM
local ds1=game:GetService("DataStoreService"):GetDataStore("DataStore1")
local ds2=game:GetService("DataStoreService"):GetDataStore("DataStore2")
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 01:00 PM
Frag

I know, but I was wondering if it messes up anything or etc


R$2,673
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
27 Jan 2015 01:00 PM
yep
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 01:02 PM
thanks

also, can you help me with this?
eror line 10: attempting to index a boolean value


local datastore = game:GetService("DataStoreService"):GetDataStore("shed")

game.Players.PlayerAdded:connect(function(p)
local shedletsky = Instance.new("BoolValue", p)
shedletsky.Name = "shedletsky"
if not datastore:GetAsync("Shedletsky"..p.userId) then --if they dont have a save
shedletsky.Value = false
else --yay! they have a save
p:WaitForDataReady()
--line 10-- if (datastore:GetAsync("Shedletsky"..p.userId).Value == true) then
shedletsky.Value = true
else
shedletsky.Value = false
end
end
end)


game.Players.PlayerRemoving:connect(function(player)
datastore:SetAsync("Shedletsky"..player.userId, player.shedletsky.Value)
end)


R$2,673
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
27 Jan 2015 01:03 PM
waitfordataready is for datapersistence not datastores


also wtf r u trying to do on line 10
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 01:04 PM
nvm fixed it

local datastore = game:GetService("DataStoreService"):GetDataStore("shed")

game.Players.PlayerAdded:connect(function(p)
local shedletsky = Instance.new("BoolValue", p)
shedletsky.Name = "shedletsky"
if not datastore:GetAsync("Shedletsky"..p.userId) then --if they dont have a save
shedletsky.Value = false
else --yay! they have a save
p:WaitForDataReady()
shedletsky.Value = datastore:GetAsync("Shedletsky"..p.userId)
end
end)


game.Players.PlayerRemoving:connect(function(player)
datastore:SetAsync("Shedletsky"..player.userId, player.shedletsky.Value)
end)


R$2,673
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
27 Jan 2015 01:05 PM
@cheif

oh, a few days ago I was learning about datastores, and someone said add :WaitForDataReady


R$2,673
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