I scripted a keybind script for tuck and I’m trying to make it so If the player doesn’t have the football in there inventory then the animation will stop. Please help. This is the script:
local Player = game.Players.LocalPlayer
local Football = workspace:FindFirstChild(“Football”)
local Tool = script.Parent.Parent
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:FindFirstChild(“Humanoid”)
wait()
local KeyPressed = Enum.KeyCode.Q
local animationId = “6289890229”
local userInputService = game:GetService(“UserInputService”)
local animationtrack = character.Humanoid:LoadAnimation(script.Tuck)
userInputService.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Input.KeyCode == KeyPressed then
if not animationtrack.IsPlaying then
animationtrack:Play()
else
animationtrack:Stop()
end
end
end)