Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 17 May 2016 09:59 PM |
| if i dont care about the old value |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37141 |
|
|
| 17 May 2016 10:12 PM |
You don't
you use SetAsync() if old value is not important |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 17 May 2016 10:24 PM |
Ok thank you, I've never used datastore without having actual intValues attached to said thing so I'm a little out of my bounds
DateGnomeSeen = game:GetService("DataStoreService"):GetDataStore("SawAGnome")
How would I then create a child with the info?
local dateseen = 5 -- days since last sighting
DateGnomeSeen:GetAsync(player.UserId, dateseen)
Or would I need to create dateseen before saving it |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
| |
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
| |
|
|
| 18 May 2016 12:29 AM |
If you truly want to be good and look professional.. And be neat about your scripts.. You need to gain a love for these three things.. functions, tables, and scopes
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
|
| 18 May 2016 12:31 AM |
You'd use GetAsync to get the key and SetAsync to save it.. You'd want to use UpdateAsync if you want it to have the greatest chance of successfully saving. << I have not attempted to use datastores.. But tables make it appear simple.
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 18 May 2016 12:31 AM |
I'd agree, but think the best way for those are in time.
Not sure if my most recent question would be considered a function or scope question. |
|
|
| Report Abuse |
|
|
|
| 18 May 2016 12:33 AM |
You'd most likely want to use a table though, because you'd be able to save more things for the player in less space.
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 18 May 2016 12:34 AM |
I am only trying to recall one value,
DateGnomeSeen = game:GetService("DataStoreService"):GetDataStore("SawAGnome") local dateseen = 5 -- days since last sighting --How would I then create a child with the info? DateGnomeSeen:GetAsync(player.UserId, dateseen) --will this automatically create datseen which can be called upon later
|
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 18 May 2016 12:35 AM |
I'm not the best at datastore, but I am gonna point out that it is userId.
|
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 18 May 2016 12:36 AM |
isn't that what i have typed?
|
|
|
| Report Abuse |
|
|
|
| 18 May 2016 12:36 AM |
I'm pretty sure it's more like... DateGnomeSeen = game:GetServer("DataStoreService"):GetDataStore("SawAGnome") local dateseen = 5
key = DateGnomeSeen:GetAsync(player.UserId) key:SetAsync(dateseen)
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
|
| 18 May 2016 12:37 AM |
oh yeh make player.UserId a string.. Keys can only be strings if i'm not mistaking
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|