Jump to content

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!

Edited by Romanful
inserting code
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

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?

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?

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...