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

Value in table always prints nil?

Asked by
Akkoza 0
4 years ago
Edited 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?

0
can you tell us where you use the function, what for? greatneil80 2647 — 4y
0
It has everything you need to know, I use it to check if an object can be carried and if it needs to display a pickup display Akkoza 0 — 4y

Answer this question