|
| 24 Jul 2016 11:04 PM |
Hello, I am trying to create a datastore for my game and I keep getting error 404 when playing the game (I am using an output gui in-game). Pictures below, maybe. Thanks!
http://share.pho.to/AENyv |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 11:07 PM |
| Please delete. Just checked rules that said you cant have links. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 11:09 PM |
Posts can't be deleted. Roblox's forum software is from ~2004 and their forum software has never been updated, ever.
It looks to me like that is an error for Data Persistence because it appears to be specific to the place and to the user, DataStores don't do that. If you are truly using DataStores, that shouldn't happen. Are you using WaitForDataReady by any chance? Because that shouldn't be used with DataStores.
|
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 11:23 PM |
No Here is the the code for the datastore below. (I am new to datastores so I went off of a tutorial with some changes). I also changed the leader.Name to "leaderstats" from "statStorage" because I couldn't see the Credit Number. I wanted it to be privately displayed on a Gui (which is done), but I will have to change "leaderstats" back to "statStorage". Could the name change be the reason why, and if so, would changing the datastore name fix it(creating a new one)? Thanks!
~~~ local DataStore = game:GetService("DataStoreService") local ds1 = DataStore:GetDataStore("TrustCurrency") print("step1")
game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader.Name = "leaderstats" print("step2") local Credits = Instance.new("IntValue",leader) Credits.Name = "Credits" print("step3") Credits.Value = ds1:GetAsync(player.userId) or 100 ds1:SetAsync(player.userId,Credits.Value) print("step4") wait(.2) print("Initial Load Complete")
Credits.Changed:connect(function() print("Saving Data") ds1:SetAsync(player.userId,Credits.Value) print("Saved "..player.userId.."'s Credit Balance of "..Credits.Value) end) end)
--Test Section--
--Used to test for data saving and such--
local creditpool = game.Workspace.creditpole
creditpool.Touched:connect(function(player) local stat = player.leader.Credits stat.Value = stat.Value + 5 print("5 Credits Added") end end)
--End Test Section--
local DataStore = game:GetService("DataStoreService") local ds1 = DataStore:GetDataStore("TrustCurrency")
game.Players.PlayerRemoving:connect(function(player) ds1:SetAsync(player.userId,player.leaderstats.Credits.Value) print("Saved "..player.userId.."'s Credit Balance of "..player.StatStorage.Credits.Value) end)
game.OnClose = function() print("Closing") wait(15) print("Closed") wait(1) end ~~~ |
|
|
| Report Abuse |
|
|