So, I'm trying to play an outfit animation via Lua, so I can have a single function for an animation independant from what outfit a character is wearing, however, it's just not working...
First I tried this:
function charAnim(c, a)
if c == nil then c = game.CurrentCharacter:getName() end
startAnimation( Characters[c].CurrentOutfit.OutfitCharacterAnimations[a] )
Then calling it via charAnim("Player", "useRight")
But then nothing happens. In the log, I get this:
12:04:15.737:Visobj useLeft could not be found in linklist
12:04:15.737:Wrong argument type for Argument #1 (expected visobject)
12:04:15.738:[string "(30,9)"]:5: Invalid syntax for command startAnimation
[C]: in function 'debugerror'
[string "function debugfunc(err) debugerror(err) end"]:1: in function
[C]: in function 'startAnimation'
[string "(30,9)"]:5: in function 'charAnim'
[string "(8,89)"]:1: in main chunk
12:04:15.738:Failed to run string in Lua:
12:04:15.738:String content: charAnim("Player", "useLeft")
"useLeft" is a Character animation name for my player, so I'm not sure why I got that error.
I tried "useRight" (also an animation name) and nothing happened. Nothing in the log either.
Thanks so much!