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

How Do i make Keybinds To play animations for tools only?

I watched tutorials and they NEVER worked! so can you please teach me how to make them work for tools for keybinds~~~~~~~~~~~~~~~~~



1 answer

I hope this would work. First of all, if you made the animation, you would copy the id of it then paste it to where it says "AnimId". Then where it says "KEYHERE" you would put the key that you would press on a keyboard (e.g. "E" key)

local tool = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=AnimId"
local anim = Animator:LoadAnimation(animation)
local UIS = game:GetService("UserInputService")

tool.Equipped:Connect(function()
	UIS.InputBegan:Connect(function(input, gameProcessedEvent)
		if input.keyCode == Enum.KeyCode.KEYHERE then
			anim:Play()
		end
	end)
end)

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