I am trying to add Extra Stats to a Unique Weapon, i’ve already tried many ways, but i can’t seem to make it to work, can someone guide me in what should i do?
In my logic, Adding a table isn’t the most convenient, because when i want to set a value, instead of adding, it would add the same value, except if i do another function for the profile wrapper to set a Certain value
ProfileWrapper Module :
function ProfileWrapperPrototype:GetObjectWithIdentifier(UniqueId : string | number)
local Character = self.Player.Character
local Backpack = self.Player.Backpack
local inventory_folder = Inventories[self.Player.Name]
for _, tool in self.Replica.Data.tools do
if tool.UniqueId ~= UniqueId then
continue
end
return table.clone(tool)
end
end
function ProfileWrapperPrototype:SetObjectExtraStats(Item, tablevalues)
if Item then
local clone_table = table.clone(Item)
warn(clone_table)
-- logic would go here
for i, values in pairs(clone_table) do
warn(values)
-- table.insert(clone_table["ExtraStats"], name)
end
task.wait(.1)
warn(tablevalues)
warn(clone_table)
end
end
Init Script :
local Item = Profile:GetObjectWithIdentifier("1b58eb82-02cb-40eb-a")
if Item then
Profile:SetObjectExtraStats(Item, {
["Damage"] = 5
})
warn(Item)
end