Thats the code:

local player = game.Players.LocalPlayer
local character = player.Character
local human = character.Humanoid

local userInput = game:GetService("UserInputService")
local AnimationId = 'rbxassetid://7588644603'

local key = 'F'
local debounce = true

userInput.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 fullPickUpAnimation = human:LoadAnimation(pickUpAnimation)
		fullPickUpAnimation:Play()
		wait(1.2)
		Animation:Destroy()
		debounce = true
	end
end)

idk i see no problem with that, could anyone explain why it doesnt work please

2 comments

0

Where did you set the "pickUpAnimation"? You set it as "Animation" and put the AnimationID inside it so thats the animation you want to load, so itd supposed to be "human:LoadAnimation(Animation)".

0

Thanks a lot, that fixed a part of the issue. The reason it actually didnt work as intended was that i accidentally put this script in StarterPlayerScripts instead of StarterCharacterScripts