local DataStoreService = game:GetService("DataStoreService") local shirtData = DataStoreService:GetDataStore("shirtData") game.Players.PlayerAdded:Connect(function(player) local clothesID = Instance.new("Folder") clothesID.Name = "clothesID" clothesID.Parent = player local shirtID = Instance.new("StringValue") shirtID.Name = "shirtID" shirtID.Parent = clothesID -- Load Data local data local success, errormessage = pcall(function() data = shirtData:GetAsync(player.UserId) end) if success then print ("Successfully loaded shirt data") shirtID.Value = data else print("Couldn't load shirt data") warn (errormessage) end end) game.Players.PlayerRemoving:Connect(function(player) local success, errormessage = pcall(function() shirtData:SetAsync(player.UserId, player.clothesID.shirtID.Value) end) if success then print ("Player shirt data sucessfully saved!") else print ("Couldn't save shirt data") warn(errormessage) end end)
So in-game the player's shirt template is saved as the value of the string "shirtID". Error I keep getting is invalid argument #3 (string expected, got nil)