I would like to know how to make animations play OnKeyDown. You know you feell like doing something or whatsoever... well anyway, thanks for listening.
COMMUNITY QUESTION
Animation on KeyDown?
2 answers
Put the Animation Into StarterPack.
Name the Animation: hybric
Insert a Local Script into StarterPack.
Make the LocalScript have this:
function Hybric(key)
local key = key:lower()
if key == "e" then -- change "e" to the Key you want it to be
script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric"
end
end
script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)
> LOOK AT LINE 4, ITS CUT OFF, THE ":PLAY(" SHOULD BE ":Play()"
my guess is to do
OnKeyDown(e) do function
play.Animation()
something like that but that wouldn't work am sure of it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
thnx :D I'll check it out... btw, would there be a possibility to play sounds with the animation? and also, you said "hybric" do you still have to put the () at the end?
At the end of line four, its cut off, the ":Play" part, change it to ":Play()"
I did... but nothing is working :( I checked the output though... it said "failed to load roblox.com/asset/id?[and then the code] could you help me with this problem?
by the way it says that there should be an end to end the if statement at line 3
16:59:08.148 - KeyDown is not a valid member of Backpack 16:59:08.149 - Script 'Players.Player1.Backpack.LocalScript', Line 8 16:59:08.149 - stack end
k, I give up!