How do you make an animation in a tool once you press a key?
I am making a war game and I need to make animations so that each tool has special keys to create animations.
For example, you can press T to throw stars once you equip the tool "Ninja Stars."
I know about this (click to play anim):
01 | Tool = script.Parent local player = game.Players.LocalPlayer repeat wait() until player.Character ~ = nil local hum = player.Character:WaitForChild( "Humanoid" ) |
03 | local animation = Tool.ToolAnim |
04 | local AnimTrack = hum:LoadAnimation(animation) |
06 | Tool.Activated:connect( function (mouse) |
07 | mouse.Button 1 Down(connect( function () |
13 | Tool.Deselected:connect( function () |
But how do i put an key in it and play an animation so the player with the tool equipped plays it whenever he presses T?