of     1   

applecake3039204536
#220489646Wednesday, July 05, 2017 2:45 AM GMT

Hello. I have reached a point where I am completely lost on what I should be doing. My goal is to make a non-playable character do a animation upon a player user key press. I have gotten it to work locally on my player-controlled unit with this script. -------------------------------------------------------------------------- Starterpack > Script > Animation wait(2) local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Anim = script.Animation Mouse.KeyDown:connect(function(key) if key == "q" then s = player.Character.Humanoid:LoadAnimation(Anim) local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play() s:Play() end end) ---------------------------------------------------------------------------- Now the issue is I'm not sure how to apply it upon the NPC character model. The character is just a copy + paste of myself. It contains the humanoid, rootpart, default animations, etc. According to wiki, "If your NPC has a Humanoid, you can simply load the animation and play it just like a regular player (except use a Script instead of a Localscript to load the Animations)." But how do I specify it to work on THAT npc humanoid specifically and not my controlled player? I have tried a couple of things and I'm just confused. I have looked around but maybe I'm just dumb. I know about AnimationController but it says not to use that on a humanoid. So where do I go from here? I have no experience with scripting in my life since today. So if it's something as simple as a pathway i'm sorry.
Wrathoxic
#220490148Wednesday, July 05, 2017 2:54 AM GMT

I don't completely understand what you're asking for. I see a 2 animations trying to be played here. I made a model explaining how to load and play an animation if it's any help. https://www.roblox.com/library/899254604/Model There's a READ ME script inside the model You're welcome
applecake3039204536
#220490592Wednesday, July 05, 2017 3:02 AM GMT

Thanks. That actually helped me a lot, and I got it to work. You're the best. ^^

    of     1