Jump to content

Help with a custom character armor settings


Recommended Posts

I am making a custom character who would be persuaded to use grass armor by having other armors slow her down (just like marble armor). 

In the Marble Armor's prefab file I found this like of code 

inst.components.equippable.walkspeedmult = TUNING.ARMORMARBLE_SLOW

so is there a way I could make every armor except for grass armor slow her down just like marble armor would? thanks!

Link to comment
Share on other sites

AddPrefabPostInt("armorwood", function(inst)
    inst.components.equippable.walkspeedmult = TUNING.ARMORMARBLE_SLOW
end)

Replace "armorwood" with others to apply to other armor types (including hat and held). You can find the code-name for every item in data/strings.lua

Link to comment
Share on other sites

On 9/9/2016 at 2:07 AM, Mobbstar said:

AddPrefabPostInt("armorwood", function(inst)
    inst.components.equippable.walkspeedmult = TUNING.ARMORMARBLE_SLOW
end)

Replace "armorwood" with others to apply to other armor types (including hat and held). You can find the code-name for every item in data/strings.lua

thank you! would I put this in modmain.lua or in the scripts/prefabs file for the character?

Link to comment
Share on other sites

On 9/8/2016 at 10:07 PM, Mobbstar said:

AddPrefabPostInt("armorwood", function(inst)
    inst.components.equippable.walkspeedmult = TUNING.ARMORMARBLE_SLOW
end)

Replace "armorwood" with others to apply to other armor types (including hat and held). You can find the code-name for every item in data/strings.lua

Wouldn't it be AddPrefabPostInit

And wouldn't this apply to everyone, and not just their character?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...