game.ReplicatedStorage.ShopBuyBackpack.OnServerEvent:Connect(function(player,page) local item = player:WaitForChild("PlayerGui"):WaitForChild("ShopBackpack"):WaitForChild("Item") local shop = game.Workspace.ShopBackpack local capacity = shop:FindFirstChild("Part"..item.Value).Capacity player.hiddendatastats.maxCapacity.Value = capacity.Value end)
purchase button script portions:
local plr = game.Players.LocalPlayer local money = plr:WaitForChild("leaderstats").Money local item = plr:WaitForChild("PlayerGui").ShopBackpack.Item local shop = game.Workspace:WaitForChild("ShopBackpack") script.Parent.Text = "Bought" game.ReplicatedStorage.BuyBackpack:FireServer(item.Value)
So whenever I buy the other backpack I have for $50 which has 25 capacity, I still have 10 capacity and my money is taken away. I've been trying to figure this out for almost half an hour.