Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

luau debounce

local debounce = 2 -- in seconds
local previousTime = os.clock()

while true do
	task.wait(0.41)
    if os.clock() - previousTime >= debounce then
		previousTime = os.clock()
	end
end

--[[
use os.clock() for the client and workspace:GetServerTimeNow() for the server
]]
 
PREVIOUS NEXT
Tagged: #luau #debounce
ADD COMMENT
Topic
Name
7+8 =