random animation with different costumes

  • #10, by sebastianFriday, 31. July 2015, 11:03 6 years ago
    i dont know what CharacterCurrentOutfit will return when you save it into a lua variable.
    on top of the script you could save the current outfit into a variable and check later if its outfit a or b or c or...
    depending on that call the function for that specific outfit. Im pretty new to lua and dont know how to call the data structure stuff out of my head but i think in the wiki is an example after the most data structure names which explain how to grab these.

    Thread Captain

    2346 Posts


  • #11, by afrlmeMonday, 03. August 2015, 13:21 6 years ago
    Please update to the latest build 1182.

    I wrote this ages ago. You should only need a single script. Please try editing the startAnimation lines like so...
    startAnimation( game.CurrentCharacter.CurrentOutfit.CharacterAnimations["useinv_n"] )
    1
    2

    -- shorthand code works best in the latest build.
    or you can use longhand code in the build you are using...
    startAnimation("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[useinv_n]")
    1
    2

    ... either of those should work for returning the animation of the current outfit.

    P.S: you could actually make this script more global by turning it into a function which you could input the animation you want to start. As long as the prefix on the end of the animation names were always the same, i.e: use_n, use_nw, take_n, take_nw, etc, then it would be a much better option than writing a script for each interaction.

    Imperator

    7008 Posts