-------------------------------------------------------------------------------------- --------------------[ GAMEPAD CONTROLS ]--------------------------------------------------- -------------------------------------------------------------------------------------- local userInputService = game:GetService("UserInputService") userInputService.InputChanged:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonX then Reloading = true if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonB then Knifing = true end if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonL1 then ThrowingGrenade = true end if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonL2 then Aiming = true end if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonY then if Stance == 0 then Stance = 1 end if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonY then if Stance == 1 then Stance = 3 end
I decided to clean up your code, making all syntax correct. This does NOT mean the following code will work, as your question was only about the end's.
-------------------------------------------------------------------------------------- --------------------[ GAMEPAD CONTROLS ]--------------------------------------------------- -------------------------------------------------------------------------------------- local userInputService = game:GetService("UserInputService") userInputService.InputChanged:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonX then Reloading = true elseif input.KeyCode == Enum.KeyCode.ButtonB then Knifing = true elseif input.KeyCode == Enum.KeyCode.ButtonL1 then ThrowingGrenade = true elseif input.KeyCode == Enum.KeyCode.ButtonL2 then Aiming = true elseif input.KeyCode == Enum.KeyCode.ButtonY then if Stance == 0 then Stance = 1 elseif Stance ==1 then Stance = 3 end end end end)