How to make it when u click a key twice it plays a different animation oppose to clicking once? [closed]
Asked by
6 years ago Edited 6 years ago
****Sorry if the title sounds weird it's the 100 character limit****
This is apart of a script in a game I'm making, the original script takes a sword from a sheath that is attached to the player via welding and, it makes the sword weld to the player's hand whilst playing this animation but, that doesn't matter so I narrowed it down so u can focus on the only parts you need to focus on to answer this question for me.
This is the script, it's a simple script that plays an animation when a key is pressed but I can't figure out how to make it so if I clicked the key twice it would play a different animation in my case put the sword back in the sheath.
01 | local Player = game.Players.LocalPlayer |
02 | local Character = Player.Character |
03 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
04 | local Anim 4 = Instance.new( "Animation" ) |
06 | local Anim 4 = Humanoid:LoadAnimation(Anim 4 ) |
08 | function onKeyDown(inputObject, gameProcessedEvent) |
09 | if inputObject.KeyCode = = Enum.KeyCode.T then |
10 | print ( "T was pressed" ) |
14 | game:GetService( "UserInputService" ).InputBegan:connect(onKeyDown) |
Closed as Not Constructive by SerpentineKing and c0des
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?