I'm trying to get a function that is in a table, but I keep getting a boolean. Why?

Table:

local CreditItems = {
["Blue Chat Name Color"] = function(Player)
if not Player then return end
local Data = GetData(Player)
if not Data then return end 
Data["CreditItems"]["Blue Chat Name Color"] = true
Data["Chat"]["NameTextColor"] = {55/255, 175/255, 255/255}
game.ReplicatedStorage.ShopInfo.SendDataS:Fire(DataTable)
return true
end;
}

Activation:

local Data = GetData(Player)
local ItemPrice = CreditPrices[tostring(ItemName)]
local ItemFunc = CreditItems[tostring(ItemName)]
print(ItemFunc) 
if Data and ItemPrice and ItemFunc then

Output:

false

Here is more Testing:

Activation

ItemFunc(Player)

Output:

08:58:02.791 - ServerScriptService.Shop:219: attempt to call local 'ItemFunc' (a boolean value)
08:58:02.792 - Stack Begin
08:58:02.793 - Script 'ServerScriptService.Shop', Line 219
08:58:02.794 - Stack End

4 comments

0

Which is line 179 in this snippet?

0

Also, what's "DataTable"? You need to provide more context

0

DataTable is just a table of everyone's stats.

0

Also, updated the question