So i tried using this script for my game, no luck, ive been trying to make a JoJo game, but im having issues with saving stands,
local DataStore = game:GetService("DataStoreService")
local GameData = DataStore("Data")
game.Players.PlayerAdded:Connect(function(Player)
local PlrStats = Instance.new("Folder",Player)
PlrStats.Name = "PlrStats"
local Stand = Instance.new("StringValue",PlrStats)
Stand.Name = "Stand"
Stand.Value = ""
local saves
pcall(function()
saves = GameData:GetAsync(Player.UserId)
end)
if saves then
warn("Player has data")
Stand.Value = saves
else
warn("No Data found")
end
end)
game.Players.PlayersRemoving:Connect(function(Player)
local PlrStats = Player:WaitForChild("PlrStats")
saveData(Player,PlrStats)
end)
function saveData(Player,PlrStats)
local Stand = PlrStats:WaitForChild("Stand")
GameData:SetAsync(Player,UserId, Stand.Value)
warn("Player Data Saved!")
end

3 comments
what does it print?
Doesnt print anything. when i reset, my "stand" folder in the players backpack disappears, so does the folder in workspace.
also the error i got from the script is "Data is not a valid member of DataStoreService"