Jump to content

Recommended Posts

I try this code in my modmain.lua:

if GLOBAL.TheNet:GetIsServer() then
    local Prefabs = GLOBAL.Prefabs
    for k, v in pairs(Prefabs) do
        AddPrefabPostInit(v, function(inst)
            if not inst.components.tradable and inst.components.equippable ~= nil then inst:AddComponent("tradable") end
        end)
    end
end

But when I enter in the game, nothing happens... I'm done something wrong, or i can do it in other way? (my objective is add the component Tradable for all equippable itens (armors, tools, weapons, amulets, etc)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...