Datastore not working

I am trying to make a way to save an IntValue that checks if the player owns an item or not. The issue is that when they buy the item and then rejoin the data doesn’t save and they do not own the item. I’ve never really succeeded that many times with data stores. I’ve tried changing it to a boolvalue but I got the same problem, however when I used a boolvalue they semt to always own the item.

--Server Script that sets up the item:
function CreateFF(player)

	local knivesfolder = player:WaitForChild('knivesfolder')
	local owns = Instance.new('IntValue')
	owns.Parent = knivesfolder
	owns.Name = 'FreezeKnife'

	local ReplicatedStorage = game:GetService("ReplicatedStorage")
	local DataStoreService = game:GetService("DataStoreService")
	local DataStore = DataStoreService:GetDataStore("Knives")

	local DefaultData = {
		owns = 0;
	}

	local Data = DataStore:GetAsync(tostring(player.UserId))

	if Data then
		owns.Value = Data
	else
		owns.Value = DefaultData.owns
	end
end

-- Save Data
local function SaveData(player)
	local owns = player.knivesfolder.owns.Value
	local ReplicatedStorage = game:GetService("ReplicatedStorage")
	local DataStoreService = game:GetService("DataStoreService")
	local DataStore = DataStoreService:GetDataStore("Knives")
	DataStore:SetAsync(tostring(player.UserId), owns)
end

game.Players.PlayerRemoving:Connect(SaveData)

game.Players.playerAdded:Connect(CreateFF)


--Creates the knife folder: (note: this is a seperate script).
function CreateFF(player)
	local knivesfolder = Instance.new("Folder")
	knivesfolder.Parent = player
	knivesfolder.Name = 'knivesfolder'
end
game.Players.playerAdded:Connect(CreateFF)

I also have a couple of scripts that run when the player buys the item that makes the ‘KnifeFreeze.Value’ 1.

Any help would be appreciated as I’ve been trying to figure this out but have never asked anyone for help about it. I have checked various threads on the devforum and haven’t gotten any answers that were functional. Any help is appreciated.

Are you wanting to give the item if they own a gamepass or? If so, you can use a gamepass and just check if they own the gamepass.

This item is bought with in-game money and not with a gamepass. I have another gamepass item that works but this one just won’t do it.

Apparently ‘local owns = player.knivesfolder.owns.Value’ was the problem as the name of the intvalue was KnifeFreeze. ‘local owns = player.knivesfolder.KnifeFreeze.Value’ worked perfectly fine.