Here is a simple method to determine how much the trigger is pressed:
local userInputService = game:GetService("UserInputService")
userInputService.InputChanged:Connect(function(inputObject)
--[[
All the triggers:
Enum.KeyCode.ButtonR1
Enum.KeyCode.ButtonR2
Enum.KeyCode.ButtonL1
Enum.KeyCode.ButtonL2
]]
if (inputObject.KeyCode == Enum.KeyCode.ButtonR1) then
print(inputObject.Position.Z)
-- Returns a percentage from 0 to 1
-- 0 being not pressed, and 1 being fully pressed
end
end)