so i have this code
cosmeticDef.RMTPlayerWantsToBuyWithCash.OnServerEvent:Connect(function(player: Player, ...: any)
--not relevant logic
if canBuy then
cosmeticDef.NUMStock.Value -= 1
if cosmeticDef.NUMStock.Value == 0 then
cosmeticDef.BOOLIsForSale.Value = false
end
local newCosmeticDefForPlayer = module.createCosmeticDef(cosmeticDef)
newCosmeticDefForPlayer.OBJPlayerWhoOwnsThis.Value = player
newCosmeticDefForPlayer.OBJCharacterWearingThis.Value = playerSheep
end
end)
and in the piece
if cosmeticDef.NUMStock.Value == 0 then
cosmeticDef.BOOLIsForSale.Value = false
end
the type checker trows the error
Type Error: (120,5) Key 'BOOLIsForSale' not found in table '{ read NUMStock: { read Value: unknown } }'
and...... why, i dont understand why is it converting the type i declared export type _cosmeticDef = typeof(script.CosmeticDef) into { read NUMStock: { read Value: unknown } }
i tested a bunch of stuff, nothing worked. the { read NUMStock: { read Value: unknown } } seems to be directly correlated to what ever the if is evaluating, so if it add if cosmeticDef.RandomStuff.Value == "acacaca" and cosmeticDef.skibidySigma.Value == "amongus" the table will expand and show them
can someone explain to me ### is happening? T_T
