I'm trying to make a shop system but line 35 is giving me an error.
_G.ownedClasses = {} function AddMoves(moveList, player) local playerMovesFolder = player.Backpack.Moves local playerMoves = playerMovesFolder:GetChildren() for i, move in ipairs(playerMoves) do move:Destroy() end for i, move in ipairs(moveList) do move.Parent = playerMovesFolder end end game.ReplicatedStorage.BuyOrEquip.OnServerEvent:Connect(function(player, name) local item = game.ServerStorage.Classes[name] local price = item.Price local skills = item.Moves:GetChildren() local coins = player.leaderstats.Coins local owns = false if table.find(_G.ownedClasses, name) then owns = true end if (owns) then AddMoves(skills, player) end if price < coins.Value and owns == false then AddMoves(skills, player) table.insert(_G.ownedClasses, name) coins.Value -= price end end)
price.Value