21:38:03.557 - GetAsync is not a valid member of DataStoreService 21:38:03.563 - Stack Begin 21:38:03.564 - Script 'ServerScriptService.Store', Line 39 21:38:03.566 - Stack End
local DataStore = game:GetService("DataStoreService")
game.Players.PlayerAdded:connect(function(Player)
wait(1)
local Gstuff = Instance.new("Folder",Player.Backpack)
Gstuff.Name = "Gamestuff"
local Chars = Instance.new("Folder",Gstuff)
Chars.Name = "Characters"
local Create = Instance.new("Folder",Chars)
Create.Name = "Folder"
local NumChars = Instance.new("IntValue",Chars)
NumChars.Name = "Number"
local BodyColors = Instance.new("BrickColorValue",Create)
BodyColors.Name = "BColors"
BodyColors.Value = BrickColor.new("Brick yellow")
local HairColor = Instance.new("BrickColorValue",Create)
HairColor.Name = "HairColor"
HairColor.Value = BrickColor.new("Buttermilk")
local HairId = Instance.new("StringValue",Create)
HairId.Name = "HairId"
HairId.Value = "Bald"
local Shirt = Instance.new("StringValue",Create)
Shirt.Name = "Shirt"
local Pants = Instance.new("StringValue",Create)
Pants.Name = "Pants"
local Face = Instance.new("StringValue",Create)
Face.Name = "Face"
Face.Value = "rbxassetid://167133081"
local Gender = Instance.new("StringValue",Create)
Gender.Name = "Gender"
Gender.Value = "Male"
local Class = Instance.new("StringValue",Create)
Class.Name = "Class"
local Level = Instance.new("IntValue",Create)
Level.Name = "Level"
Level.Value = 0
local key = "Player-"..Player.userId
local SavedValues = DataStore:GetAsync(key)
if SavedValues then
--Save Format -- {BodyColors,HairColor,HairId,Shirt,Pants,Face,Gender,Class,Level,NumChars}
BodyColors.Value = SavedValues[1]
HairColor.Value = SavedValues[2]
HairId.Value = SavedValues[3]
Shirt.Value = SavedValues[4]
Pants.Value = SavedValues[5]
Face.Value = SavedValues[6]
Gender.Value = SavedValues[7]
Class.Value = SavedValues[8]
Level.Value = SavedValues[9]
Level.Value = SavedValues[10]
else
local ValuesToSave = {BodyColors.Value,HairColor.Value,HairId.Value,Shirt.Value,
Pants.Value,Face.Value,Gender.Value,Class.Value,Level.Value,NumChars.Value}
DataStore:SetAsync(key, ValuesToSave)
end
end)
21:38:27.380 - SetAsync is not a valid member of DataStoreService 21:38:27.382 - Stack Begin 21:38:27.383 - Script 'ServerScriptService.Data', Line 18 21:38:27.384 - Stack End
local DataStore = game:GetService("DataStoreService")
game.Players.PlayerRemoving:connect(function(Player)
if Player.Backpack.Gamestuff.Characters:findFirstChild("Character1") then
local NumChars = Player.Backpack.Gamestuff.Characters.Number
local BodyColors = Player.Backpack.Gamestuff.Characters.Character1.BColors
local HairColor = Player.Backpack.Gamestuff.Characters.Character1.HairColor
local HairId = Player.Backpack.Gamestuff.Characters.Character1.HairId
local Shirt = Player.Backpack.Gamestuff.Characters.Character1.Shirt
local Pants = Player.Backpack.Gamestuff.Characters.Character1.Pants
local Face = Player.Backpack.Gamestuff.Characters.Character1.Face
local Gender = Player.Backpack.Gamestuff.Characters.Character1.Gender
local Class = Player.Backpack.Gamestuff.Characters.Character1.Class
local Level = Player.Backpack.Gamestuff.Characters.Character1.Level
local key = "Player-"..Player.userId
local ValuesToSave = {BodyColors.Value,HairColor.Value,HairId.Value,Shirt.Value,
Pants.Value,Face.Value,Gender.Value,Class.Value,Level.Value,NumChars.Value}
DataStore:SetAsync(key, ValuesToSave)
end
end)
