Hi, when I leave the game, it says that my String is not a valid member of a folder. It's used for a datastore.
Here is all related code.
local gun1 = DataStore:GetDataStore("gun1")
game.Players.PlayerAdded:Connect(function(player)
local parent = Instance.new("Folder")
parent.Name = "PlayerGuns"
parent.Parent = player
local gun1string = Instance.new("StringValue")
gun1string.Name = "Gun1"
gun1string.Value = gun1:GetAsync(player.userId) or "startergun1"
gun1string.Parent = parent
end)
game.Players.PlayerRemoving:Connect(function(player)
gun1:SetAsync(player.userId, player.PlayerGuns.gun1string.Value)
end)

2 comments
thanks
No problem :D I glad to help peoples :)