How would i access this in the datastore?

So ive been trying to make a inventory screen unfortunately it just keeps crashing. I mean pretty sure its because i tried to remove a part of the datastore but not sure. This is in a local script but im lost on how i would access the playerData for the RequiredExp. Anything i try just crashes studio and the game itself so any help would be appreciated.

local playerData = {
		["Points"] = 1000,
		["SelectedTowers"] = {"Sword Player"},
		["SelectedSword"] = {"Linked Sword"},
		["Level"] = 1,
		["Exp"] = 0,
		["RequiredExp"] = playerData.Level * 341,
		["Rewarded"] = false,
		["OwnedTowers"] = {"Sword Player","Rocket Noob"},
		["OwnedSwords"] = {"Linked Sword"},
	}	

local function getItemStatus(itemName)
	if table.find(playerData.SelectedTowers, itemName) then
		return "Equip"
	elseif table.find(playerData.OwnedTowers, itemName) then
		return "Owned"
	else 
		return "For Sale"
	end
end

local function interactTower(itemName)
	local data  = interactItemFunction:InvokeServer(itemName)
	if data then
		playerData = data
	end
end

function ItemsInv()
	for i, tower in pairs(towers) do
		local oldButton = gui.Inventory.InvShop.ItemsFrame:FindFirstChild(tower.Name)
		if oldButton then 
			oldButton:Destroy()
		end
		local status = getItemStatus(tower.Name)
		if status == "For Sale" then
		elseif status == "Equip" then
			gui.Inventory.InvShop.ItemsFrame.Status.Text = "Equip"
		else
			gui.Inventory.InvShop.ItemsFrame.Status.Text = "Unequip"
		end
		if status or #playerData.SelectedTowers == "Equip" then
			local button = gui.Inventory.InvShop.ItemsFrame:Clone()
			button.Name = tower.Name
			button.TowerName.Name = tower.Name
			button.Visible = ReplicatedStorage:FindFirstChild(player.Name):FindFirstChild(tower.Name)
			button.Parent = gui.Inventory.InvShop.ItemsFrame
			
			
			button.Status.Activated:Connect(function()
				interactTower(tower.Name)
			end)
		end
	end
end
ItemsInv()

local function toggleInventory()
	gui.Inventory.Visible = not gui.Inventory.Visible
	if gui.Inventory.Visible then
		playerData = getDataFunction:InvokeServer()
		ItemsInv()
	end
end

local function setupInv()
	local button = gui.OpenInv
	button.Activated:Connect(toggleInventory)
end
setupInv()

If it’s crashing studio then its certainly a bug. Try and find the minimum amount of code to have it crash and then report it.