local Input = require(script.Parent:WaitForChild("Input"))

local Character = script.Parent.Parent
local Humanoid = Character.Humanoid

local ParadeRest = script:WaitForChild("ParadeRest")
local HandSalute = script:WaitForChild("HandSalute")
local Attention = script:WaitForChild("Attention")

local HandSaluteDebounce = false
local AttentionDebounce = false
local ParadeRestDebounce = false

local HandSaluteAnimation = Humanoid:LoadAnimation(HandSalute)
local ParadeRestAnimation = Humanoid:LoadAnimation(ParadeRest)
local AttentionAnimation = Humanoid:LoadAnimation(Attention)

Input.BindKeyPresses("HandSalute",function()
	if HandSaluteDebounce == false then
		HandSaluteDebounce = true
		HandSaluteAnimation:Play()
	elseif HandSaluteDebounce == true then
		HandSaluteDebounce = false
		HandSaluteAnimation:Stop()
	end
end, Enum.KeyCode.LeftControl, Enum.KeyCode.H)

The input function works perfectly fine, I've tested it before. It's just the animation, there are no errors when it runs, so if you could help me out that would be great. I want the animation to be toggleable. That's why there is a debounce, but it's not actually I debounce It's just the toggle system.

3 comments

0

Hmmm.. I don’t know what’s wrong.. maybe try checking if you have any unnecessary variables?

0

Or try getting the character variable with that wait for character function thingy

0

It’s like 2am where I live and my brain is deactivated