nut.anim - Chessnut/NutScript GitHub Wiki

This library provides a system to set up models with animation groups so they appear correctly in-game.

Methods

  • nut.anim.setModelClass(model, class)
  • A shared function to group a certain model with a specific animations. Class is a string that can be: "citizen_male", "citizen_female", "metrocop", "overwatch", "vort", "player", "zombie" and "fastZombie". Note that the last three are only for regular player models, not NPC models.
  • nut.anim.getModelClass(model)
  • Returns the class for the model specified. If one has not been set previously, it will default to "player" if the model contains "/player", otherwise the citizen classes.

Extensions

Player

  • client:forceSequence(sequence, callback, time, noFreeze)
  • Server-side function that overrides the player's current animation to play another animation. sequence is a string for the animation that can be viewed within the HL2 Model Viewer. callback is an optional function that gets called after the sequence is finished. time is an optional number to override how long the sequence plays for. noFreeze is an optional boolean to determine whether or not the player can move during the sequence.
  • client:leaveSequence()
  • Stops the player's forced sequence, unfreezes the player and calls the callback from the forced sequence if provided.