Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I Make Key To Load Animation?

Asked by 4 years ago

Can Someone Tell Me How To Make Key To Load Animation?

0
show some kind of a script VVoretex 146 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

A bit of UIS and extra script to resolve your problem.

01local UIS = game:GetService("UserInputService")
02local Player = game.Players.LocalPlayer
03local Character = Player.Character
04local Anim = Instance.new("Animation")
05local debounce = false
06Anim.AnimationId = "rbxassetid://4751394808" --Put your animation here
07local PlayAnim = Character.Humanoid:LoadAnimation(Anim)
08wait(0.3)
09UIS.InputBegan:Connect(function(input,IsTyping)
10    if IsTyping then return end
11if input.KeyCode == Enum.KeyCode.T then --Pick a key letter you want
12if not debounce then
13debounce = true
14print("Animation starting.")
15wait(0.5) --Putting a small wait in between doing the function again
16debounce = false
17end
18   end
19 end)
Ad

Answer this question