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 3 years ago

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

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

1 answer

Log in to vote
0
Answered by 3 years ago

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

local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character 
local Anim = Instance.new("Animation")
local debounce = false
Anim.AnimationId = "rbxassetid://4751394808" --Put your animation here
local PlayAnim = Character.Humanoid:LoadAnimation(Anim) 
wait(0.3)
UIS.InputBegan:Connect(function(input,IsTyping) 
    if IsTyping then return end
if input.KeyCode == Enum.KeyCode.T then --Pick a key letter you want 
if not debounce then
debounce = true
print("Animation starting.")
wait(0.5) --Putting a small wait in between doing the function again
debounce = false
end 
   end
 end) 

Ad

Answer this question