How would I measure the time between the inputState going from begin to end (essentially how long the button is held)
local function EvasiveAndTransportLogic(_input: string, inputState: Enum.UserInputState, _inputObject: InputObject)
if _input == "EvasiveAndTransportLogic" and inputState == Enum.UserInputState.Begin and humanoid then
-- Use the user's evasive move when the user activates their evasive move
local playerEvasive = humanoid:GetAttribute("CurrentEvasive")
local evasiveFolder = script.Parent.Evasives
--where do i even start
-- if tap then
require(evasiveFolder[playerEvasive]):Perform(character)
--elseif hold then
--do whatever
--end
end
end
local buttonHoldStartTime = nil
local function EvasiveAndTransportLogic(_input: string, inputState: Enum.UserInputState, _inputObject: InputObject)
if _input == "EvasiveAndTransportLogic" then
if inputState == Enum.UserInputState.Begin then
buttonHoldStartTime = tick()
elseif inputState == Enum.UserInputState.End then
if buttonHoldStartTime then
local holdDuration = tick() - buttonHoldStartTime
print(holdDuration)
buttonHoldStartTime = nil
end
end
end
end