Question : luau make debounce
Answered by : tomsterbg
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
]]
Source : | Last Update : Thu, 19 May 22