My current idea is to create a module script on the server storage that will keep all the backpack data and in another script would be the logic to apply the buffs.
An example would be the bag increasing your movement speed by 20%, what would be the best approach for this system or any tips on how I can continue
local replicatedStorage = game:GetService("ReplicatedStorage");
local prefabs = replicatedStorage:WaitForChild("Prefabs");
export type PowerUp = {
type: "WalkSpeed",
value: number,
}
export type Bag = {
type: ItemType,
name: string,
description: string,
price: NumberValue,
icon: string,
maxSlots: number,
powerUp: PowerUp,
}
local data: {[string] : Bag} = {
A = {
type = "Bag",
name = "A",
description = "Start backpack",
price = 0,
icon = "",
maxSlots = 20,
},
B = {
type = "Bag",
name = "B",
description = "A very primitive backpack",
price = 250,
icon = "",
maxSlots = 30,
powerUp = {
type = "WalkSpeed",
value = 20,
}
}
}
local BagsData = {}
BagsData.Data = data;
return BagsData