Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A value from a table always prints nil when it has a value?

Asked by
Akkoza 0
4 years ago
--[[{"Destructable":true,"Health":20,"State":"Crate1","Holdable":true}]] --(table)
function grabData(object)
    local dataTable
    if object:WaitForChild("Data",0.001) then
        dataTable = game:GetService("HttpService"):JSONDecode(object.Data.Value)
    end
    print(dataTable.Holdable) -- always prints nil?
    if dataTable == nil then return nil else return dataTable end
end

It should print true, but always prints nil, even when there is a value for it?

Answer this question