I am having trouble finding a spot to place a animation ID. When i place it any where the gun either fires one round and frezzes, or the animation ID that is place does nothing. The animation is going to be character movement. How would I tell the script to play animation when "R" is pressed and when gun is firing play recoil animation. Note this is not a request I just need a VALID answer.
This requires you to use the UserInputService.
Also, to use an animation, you'll have to create it yourself, as ROBLOX blocks access to other people's animations for whatever reason.
Here's a small bit of code to help you get started.
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=Your ID here" local animTrack = nil function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.R then animTrack = player.Humanoid:LoadAnimation(animation) print("R was pressed") --You'll want to put your code here animTrack:Play() end end