There don’t seem to be any posts or tutorials on this topic, I am currently working on a game (FPS shooter type) and I have been wondering how I would be able to get a user’s reaction time. I want to get their reaction time and compare it to other users.
Reaction time of what?
We need details.
A way of detecting the length of a time is using tick().
You can do it sorta like this
local reactionStart = tick()
local function playerReact()
local reactionTime = tick() - reactionTime -- this will be in seconds
end
2 Likes
As was mentioned by tarneks, you could use the tick() thingy:
local reactionStart = tick()
local function playerReact()
local reactionTime = tick() - reactionStart
end
game:GetService("UserInputService").InputBegan:Connect(playerReact)
-- Will do it no matter what the user actually presses. If you want it
-- to be just for the mouse click, lmk
(I made a couple of modifications to make it work a bit better out of the box)