Make my model more easier to use?

Ok, so I want to make a daily shop command but right now my model is so unorganized so is there any way I could make it so it’s more assessable?

A bit of the code:

cooldown: {
        type: Number,
        default: 0,
    },
    

    Common_Swords: {
        type: String,
        default: "None",
    },
    Common_Swords_Price: {
        type: Number,
        default: 0
    },

    Uncommon_Swords: {
        type: String,
        default: "None",
    },
    Uncommon_Swords_Price: {
        type: Number,
        default: 0
    },

    Rare_Swords: {
        type: String,
        default: "None",
    },
    Rare_Swords_Price: {
        type: Number,
        default: 0
    },

    Epic_Swords: {
        type: String,
        default: "None",
    },
    Epic_Swords_Price: {
        type: Number,
        default: 0
    },

    Legendary_Swords: {
        type: String,
        default: "None",
    },
    Legendary_Swords_Price: {
        type: Number,
        default: 0
    },

This goes on for each category. Swords is just one… Is there any way I can make it look better and take up less code?

You can try something like this:

cooldown: {
        type: Number,
        default: 0,
    },
swords:{
    common: String,
    commonp: Number,
    uncommon: String,
    uncommonp: Number,
    rare: String,
    rarep: Number,
    epic: String,
    epicp: Number,
    legendary: String,
    legendaryp: Number,
},
anothertypeofitem:{
    carryondoingthis: String,
}

Or use arrays or something

Best thing to do is have a read:

2 Likes

Thanks!!!