How to get the current holding time of the proximity prompt?

Hello, so im making an interaction system with a progress bar. And the problem is that. It just offset the exact time and the time im tracking. So I dont know how to do. Anyone got an idea? Please help!

Most of the time its actually done locally and then the server is fired upon completion, this removes the delay between the client and the server.

1 Like

can you please explain more. are you trying to find the time for how long a player pressed ā€œEā€ on their keyboard for a prompt?

1 Like

Yes yes yes It is what i wanted to find!

local proxprompt = -- path to proximity prompt

local starttick
local duration
proxprompt.PromptButtonHoldBegan:Connect(function()
	starttick = tick()
end)
proxprompt.PromptButtonHoldEnded:Connect(function()
	duration = math.round(tick()-starttick)
	print(duration)
end)
1 Like

Oh im sorry, I forgot to tell taht the bar updates every 0.1 second!

Also forgot to tell,
my proximity hold duration is 5:
result: (when finished)
image

well you can find some scripts that round to decimal values like this one!

Wait I forgot about this one! Thanks

Wait I forgot to mark this as an solution, you can loop this and send the data.