I’m a bit confused about this error as well as how I could fix it. The bloxy cola code line works, but the other lines don’t.
Code:
game.ReplicatedStorage.Events.Products.BuyDrink.OnServerEvent:Connect(function(player, item)
local CashValue = game.ReplicatedStorage:WaitForChild("ClubCash"):WaitForChild(player.Name)
if CashValue:WaitForChild("Cash").Value >= 5 then
if item == "Bloxy Cola" then
CashValue:WaitForChild("Cash").Value = CashValue:WaitForChild("Cash").Value - 5
local Cola = game.ReplicatedStorage.Shop.Drinks.BloxyCola:Clone()
Cola.Parent = player.Backpack
elseif item == "Lemonade" then
CashValue:WaitForChild("Cash").Value = CashValue:WaitForChild("Cash") - 5
local Lemonde = game.ReplicatedStorage.Shop.Drinks.Lemonade:Clone()
Lemonde.Parent = player.Backpack
elseif item == "Coffee" then
CashValue:WaitForChild("Cash").Value = CashValue:WaitForChild("Cash") - 5
local Coffee = game.ReplicatedStorage.Shop.Drinks.Coffee:Clone()
Coffee.Parent = player.Backpack
elseif item == "Chocolate Milk" then
CashValue:WaitForChild("Cash").Value = CashValue:WaitForChild("Cash") - 5
local ChocolateMilk = game.ReplicatedStorage.Shop.Drinks["Chocolate Milk"]:Clone()
ChocolateMilk.Parent = player.Backpack
end
end
end)