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

How do I get the list length from a module script?

Asked by 2 years ago

Issue:

I am using print(#module.sauces) , but that returns 0 every time! How would I really do this?

Module:

local replicatedstr = game:GetService('ReplicatedStorage')



local items = {
    sauces = {
        tartarsauce = {
            id = 'rbxassetid://7157058073',
            name = 'Tartar Sauce',
            item = replicatedstr.PizzaCondiments.Sauces:FindFirstChild('Tartar'),
            description = "You'd have to be insane to put this on pizza!",
            quality = 1,
            cost = 2.5
        },
        normalsauce = {
            id = 'rbxassetid://7157007979',
            name = 'Basic Sauce',
            item = replicatedstr.PizzaCondiments.Sauces:FindFirstChild('Sauce1'),
            description = 'It is not much, but it can do the job quite nicely!',
            quality = 3,
            cost = 5
        },
        fancysauce = {
            id = 'rbxassetid://7157007914',
            name = 'Fancy Sauce',
            item = replicatedstr.PizzaCondiments.Sauces:FindFirstChild('FancySauce'),
            description = 'For the elite',
            quality = 5,
            cost = 20
        }
    },
    doughs = {

    },
    toppings = {

    },


}


return items

Answer this question