Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
|
| 06 Jul 2016 12:28 PM |
I was online yesterday working on my game and Data Store seemed to be working perfectly fine on studio. The next day (Today) I pressed play on studio and it's not making the folder that the data is supposed to be stored in. I tried putting my data store scripts into different places that aren't in the same universe and It's still not creating the folder. Does anyone know why this is happening? My game is broke now since data store seems to be glitched.
|
|
|
| Report Abuse |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 12:32 PM |
post the script
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
|
| 06 Jul 2016 12:36 PM |
Creates the Data -
local DataStore = game:GetService("DataStoreService"):GetDataStore("Data") game.Players.PlayerAdded:connect(function(player)
local Folder = Instance.new("Folder", player) Folder.Name = "Data" local XP = Instance.new("NumberValue", Folder) XP.Name = "XP" local Level = Instance.new("NumberValue", Folder) Level.Name = "Level" player.Data.Level.Value = 1 local MaxXP = Instance.new("NumberValue", Folder) MaxXP.Name = "MaxXP" local Energy = Instance.new("NumberValue", Folder) Energy.Name = "EnergyBar" local Attribute = Instance.new("NumberValue", Folder) Attribute.Name = "Attribute" local StrengthSTAT = Instance.new("NumberValue", Folder) StrengthSTAT.Name = "StrengthSTAT" StrengthSTAT.Value = 10 local RageSTAT = Instance.new("NumberValue", Folder) RageSTAT.Name = "RageSTAT" RageSTAT.Value = 10 local EnergySTAT = Instance.new("NumberValue", Folder) EnergySTAT.Name = "EnergySTAT" EnergySTAT.Value = 10 local IsCharging = Instance.new("BoolValue", Folder) IsCharging.Name = "IsCharging" local IsFlying = Instance.new("BoolValue", Folder) IsFlying.Name = "IsFlying" local IsPunching = Instance.new("BoolValue", Folder) IsPunching.Name = "IsPunching" local IsSSJ1 = Instance.new("BoolValue", Folder) IsSSJ1.Name = "IsSSJ1" local IsSSJ2 = Instance.new("BoolValue", Folder) IsSSJ2.Name = "IsSSJ2" local IsKioken = Instance.new("BoolValue", Folder) IsKioken.Name = "IsKioKen" local TransDone = Instance.new("BoolValue", Folder) TransDone.Name = "TransDone" local SSJ1Key = Instance.new("StringValue", Folder) SSJ1Key.Name = "SSJ1Key" local SSJ2Key = Instance.new("StringValue", Folder) SSJ2Key.Name = "SSJ2Key" local RPName = Instance.new("StringValue", Folder) RPName.Name = "RPName" local RageDisplay = Instance.new("NumberValue", Folder) RageDisplay.Name = "RageDisplay" wait() local SSJ2timer = Instance.new("NumberValue", Folder) SSJ2timer.Name = "SSJ2Timer" local SSJ1timer = Instance.new("NumberValue", Folder) SSJ1timer.Name = "SSJ1Timer" local StrengthHealth = Instance.new("NumberValue", Folder) StrengthHealth.Name = "StrengthHealth" local Zeni = Instance.new("NumberValue", Folder) Zeni.Name = "Zeni"
--local PunchingFX = Instance.new("Sound", player.Character.Torso) --PunchingFX.Name = "PunchingFX" --PunchingFX.SoundId = "http://www.roblox.com/asset/?id=137579113"
local key = "player-"..player.userId.." Data0"
local SavedValues = DataStore:GetAsync(key)
if SavedValues then XP.Value = SavedValues[1] Level.Value = SavedValues[2] MaxXP.Value = SavedValues[3] EnergySTAT.Value = SavedValues[4] Attribute.Value = SavedValues[5] StrengthSTAT.Value = SavedValues[6] RageSTAT.Value = SavedValues[7] Zeni.Value = Zeni.Value[8] else local ValuesToSave = {XP.Value , Level.Value, MaxXP.Value, EnergySTAT.Value, Attribute.Value, StrengthSTAT.Value, RageSTAT.Value, Zeni.Value } DataStore:SetAsync(key, ValuesToSave) end end)
SAVES THE DATA WHEN THEY LEAVE -
DataStore = game:GetService("DataStoreService"):GetDataStore("Data") game.Players.PlayerRemoving:connect(function(player) local key = "player-"..player.userId.." Data0" local ValuesToSave = {player.Data.XP.Value , player.Data.Level.Value, player.Data.MaxXP.Value, player.Data.EnergySTAT.Value, player.Data.Attribute.Value, player.Data.StrengthSTAT.Value, player.Data.RageSTAT.Value, player.Data.Zeni.Value} DataStore:SetAsync(key, ValuesToSave) end)
|
|
|
| Report Abuse |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 12:41 PM |
The folder isn't created at all? Are there any errors?
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
|
| 06 Jul 2016 12:46 PM |
The only errors that output is "StrengthSTAT is not a valid member of Data." That only prints out because my other gui's etc. depends on the datastore.
|
|
|
| Report Abuse |
|
Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
| |
Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
| |
Cestil
|
  |
| Joined: 12 Jun 2012 |
| Total Posts: 119 |
|
|
| 06 Jul 2016 03:26 PM |
Can someone please help!?!?
|
|
|
| Report Abuse |
|