can anyone tell me why I am getting the error below on the last line 61,
ServerScriptService.PetSystem.Modules.PetHandler:61: attempt to compare number <= table - Server - PetHandler:61
local lMoney = DataStore2("Money", Player)
local lEggPrice = EggInfo[Egg].Price[1]
if Type == 1 then
print("lMoney = " .. tostring(lMoney:Get(0)))
print("EggPrice = " .. tostring(lEggPrice))
if lMoney >= lEggPrice then
The error is self explanatory, lMoney is a table. You probably forgot to actually get the value of money from the money datastore.
local lMoney = DataStore2("Money", Player)
local lEggPrice = EggInfo[Egg].Price[1]
if Type == 1 then
local Money = lMoney:Get(0) -- get value of money from datastore
print("lMoney = " .. tostring(Money))
print("EggPrice = " .. tostring(lEggPrice))
if Money >= lEggPrice then