Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a Key pressing function?

1 answer

✓ Accepted answer

This should work :

--//
local UIS = game:GetService("UserInputService")
local p = game.Players.LocalPlayer

--//
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=idhere"
local animTrack = Humanoid:LoadAnimation(animation)


UIS.InputBegan:Connect(function(Input, gameProcessedEvent)
local KeyCode = Input
if not gameProcessedEvent then

if KeyCode == Enum.KeyCode.F then
animTrack:Play()

end
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.