vydlv
|
  |
| Joined: 08 Jun 2010 |
| Total Posts: 1517 |
|
|
| 27 Feb 2015 08:05 PM |
Sorry for bad subject, had to take out some stuff when I ran out of room.
So if I'm making a shop for my game where you can buy different things such as "linkedsword", "illumina", "darkheart," how should I save that using data stores?
make a table with all the items the player owns? (you can save tables, right?) make like a string with all the player's items? somehow save everything separately?
I would think separately would be more easy to save (the shop wouldn't have just 3 items so saving the whole things sounds like a waste) but idk |
|
|
| Report Abuse |
|
|
vydlv
|
  |
| Joined: 08 Jun 2010 |
| Total Posts: 1517 |
|
| |
|
vydlv
|
  |
| Joined: 08 Jun 2010 |
| Total Posts: 1517 |
|
| |
|
vydlv
|
  |
| Joined: 08 Jun 2010 |
| Total Posts: 1517 |
|
| |
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 27 Feb 2015 10:16 PM |
Honestly, using Data-Persistence here would be much less complex than getting into DataStores.
-- Player buys LinkedSword, send request to RemoteEvent to save this value as true player:SaveBoolean("OwnsLinkedSword", true);
-----------
-- Player enters server, let the server know if they own the sword or not local playerHasSword = player:LoadBoolean("OwnsLinkedSword");
if playerHasSword then -- give them the sword end; |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 27 Feb 2015 10:21 PM |
local datastore = game:GetService("DataStoreService"):GetDataStore("yes")
datastore:SetAsync(key,value) datastore:GetAsync(key) datastore:UpdateAsync(key, func) |
|
|
| Report Abuse |
|
|