Hello, I'm having problems with my keyblind. (Q) When I press It, nothing happens. Here, take look at my script.

local Player = game.Players.LocalPlayer
local Character = Player.Character or script.Parent
local Humanoid = Character.Humanoid 
local UserInputService = game:GetService("UserInputService")
local AnimationID = 'rbxassetid://5175522205'
local Debounce = true
local key = 'Q'
UserInputService.InputBegan:Connect(function(Input, IsTyping)
 if IsTyping then return end
 if Input.KeyCode == Enum.KeyCode[key]and Debounce == true then
  Debounce = false
  local Animation = Instance.new("Animation")
  Animation.AnimationId = AnimationID
  local LoadAnimation = Humanoid:LoadAnimation(Animation)
  LoadAnimation:Play()
  wait(1)
  Animation:Destroy()
  Debounce = true
 end

end)

2 comments

0

Maybe you forgot to parent the animation to the workspace? I don't think you can load animations without them having parents.

0

It does have a parent