like as i said on the title this code doesnt detect the “ButtonA”
i did it “ButtonB” to see if the error is in the code but it worked with no problem
local UIS = game:GetService("UserInputService")
local Player = game:FindFirstChild("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local L2anim = Animator:LoadAnimation(script.L2)
local L1anim = Animator:LoadAnimation(script.L1)
local R2anim = Animator:LoadAnimation(script.R2)
local R1anim = Animator:LoadAnimation(script.R1)
local ButtonXanim = Animator:LoadAnimation(script.ButtonX)
local ButtonAanim = Animator:LoadAnimation(script.ButtonA)
local L2 = false
local L1 = false
local R2 = false
local R1 = false
local ButtonX = false
local ButtonA = false
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonL2 and not gameProcessedEvent then
if L2 == false then
L2anim:Play()
L2 = true
print("1")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonL2 and not gameProcessedEvent then
if L2 == true then
L2anim:Stop()
L2 = false
end
end
end)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonL1 and not gameProcessedEvent then
if L1 == false then
L1anim:Play()
L1 = true
print("2")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonL1 and not gameProcessedEvent then
if L1 == true then
L1anim:Stop()
L1 = false
end
end
end)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonR2 and not gameProcessedEvent then
if R2 == false then
R2anim:Play()
R2 = true
print("1")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonR2 and not gameProcessedEvent then
if R2 == true then
R2anim:Stop()
R2 = false
end
end
end)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonR1 and not gameProcessedEvent then
if R1 == false then
R1anim:Play()
R1 = true
print("2")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonR1 and not gameProcessedEvent then
if R1 == true then
R1anim:Stop()
R1 = false
end
end
end)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonX and not gameProcessedEvent then
if ButtonX == false then
ButtonXanim:Play()
ButtonX = true
print("2")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonX and not gameProcessedEvent then
if ButtonX == true then
ButtonXanim:Stop()
ButtonX = false
end
end
end)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonB and not gameProcessedEvent then
if ButtonA == false then
ButtonAanim:Play()
ButtonA = true
print("2")
end
end
end)
UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.ButtonB and not gameProcessedEvent then
if ButtonA == true then
ButtonAanim:Stop()
ButtonA = false
end
end
end)