How to check whether a player has not right clicked twice

I want to make a script in which after a player does not click twice in a specific time, it prints out s.
Heres what i tried.

local Time = tick()
mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function()
	if tick() - Time < 6 then -- tick() - Time would be the time elapsed
		print("double Click!")
	else
		print("s")
	end
	Time = tick()
end)

But this only prints when we click after the time is over. i want it to happen automatically.
After 6 seconds of a right click, i want it to print s without having the player click again/
I have literally no idea how to do this and help will be appreciated.
Ty :slight_smile:

Because you hook it on the Button1Down event.

Can you try:

local Time = tick()
mouse = game.Players.LocalPlayer:GetMouse()

mouse.Button1Down:Connect(function()
	if tick() - Time < 6 then -- tick() - Time would be the time elapsed
		print("double Click!")
	end
	Time = tick()
end)

 while wait(1) do -- wait 1 second, 1/30th of a second no no
     if tick() - Time < 6 then print("s") end 
 end

Yes sorry for the late reply.
Ill try it.

No, i want it to print s only when after 6 seconds a player does not click.
This does it every 1 sec.