Help with a string datastore error

I have a datastore that is supposed to save your “Clan” but I get a error on line 7 and 13 could you help,

local DataStoreService = game:GetService("DataStoreService");
local DataStore = DataStoreService:GetDataStore("BannedDataStore");

game.Players.PlayerAdded:Connect(function(player)
	local stringval = Instance.new("StringValue", player)
	stringval.Name = "Family"
	stringval.Value = DataStore:GetAsync(player.UserId) or false --here

	
end)

game.Players.PlayerRemoving:Connect(function(player)
	DataStore:SetAsync(player.UserId, player:FindFirstChild("Value").Value) --here 
end)

image
image

Hello! Three major issues here. The first is that you are setting the parent of the value via the Instance.new()'s parameter. Instead, set the parent traditionally after you change the instance’s properties. This will help with performance (if I remember correctly). The second issue lies with how you set the value. A StringValue cannot have its value set to a boolean (e.g. false); it must be a string. You can solve this my changing false to “false” or “” (as it can’t be nil). The third issue would be how you get the value at the end. You changed the name to “Family”, therefore “Value” does not exist. Hope this helped! And here’s the updated code:

local DataStoreService = game:GetService("DataStoreService");
local DataStore = DataStoreService:GetDataStore("BannedDataStore");

game.Players.PlayerAdded:Connect(function(player)
	local stringval = Instance.new("StringValue")
	stringval.Name = "Family"
	stringval.Value = DataStore:GetAsync(player.UserId) or ""
	stringval.Parent = player
	
end)

game.Players.PlayerRemoving:Connect(function(player)
	DataStore:SetAsync(player.UserId, player:FindFirstChild("Family").Value) --here 
end)