- To user BatterUp, first initialize it with this line of code:
local batterUp = require("BatterUp")- Then, add your animations to a table, this is code from the example avatar:
local anim = animations.model
local chained = {
anim.chain1,
anim.chain2,
anim.chain3,
}- And finally, run the function to add the animations
batterUp:addChainedSwings(chained,"right","wooden_sword","attack",true,20)Chained swings will play in the order they're inserted into the table
The addChainedSwings function has 6 arguments
- The table containing the animations, it must have 2 or more animations in it
- A string "left" or "right" which determines if the chains should only play when the left or right arm is swinging, by default this is nil and will play when either arm swings
- A string for the item's Minecraft ID or it's name. Inserting an id/name will make it only play the animations when swinging with that weapon
- A string to determine if the animation should play while attacking or mining. Options are "attack" or "mine", by default the animation will play during either circumstance
- A boolean to determine if the animation's speed should match the vanilla animation's length, by default it won't change the animation speed
- A number in ticks, determines how long it should wait before resetting the chain, by default it won't reset the chain
A random animation will be picked out of the table in order to be played, it will never repeat the same animation twice
The addRandomSwings function has 5 arguments
- The table containing the animations, it must have 2 or more animations in it
- A string "left" or "right" which determines if the chains should only play when the left or right arm is swinging, by default this is nil and will play when either arm swings
- A string for the item's Minecraft ID or it's name. Inserting an id/name will make it only play the animations when swinging with that weapon
- A string to determine if the animation should play while attacking or mining. Options are "attack" or "mine", by default the animation will play during either circumstance
- A boolean to determine if the animation's speed should match the vanilla animation's length, by default it won't change the animation speed