search/
Start typing to search packages!
package_2
timer
By @zac134
Roblox
MirroredTimer Module
Overview
The Timer module provides a simple and efficient way to manage countdown timers in the game. It allows you to create timers that can count down from a specified duration, trigger events when the time changes, and notify when the timer has ended.
Features
- Create a new timer with a specified countdown duration.
- Start the timer and track the elapsed time.
- Receive updates on the remaining time through events.
- Cleanly destroy the timer and release resources.
Usage
To use the Timer module, follow these steps:
-
Create a Timer Instance:
local Timer = require(path.to.Timer) local myTimer = Timer.new(60) -- Create a timer for 60 seconds -
Start the Timer:
myTimer:Start() -- Start the countdown -
Connect to Time Changed Event:
myTimer.TimeChanged:Connect(function(remainingTime) print("Time remaining: " .. remainingTime) end) -
Connect to Timer Ended Event:
myTimer.TimerEnded:Connect(function() print("Timer has ended!") end) -
Destroy the Timer:
myTimer:Destroy() -- Clean up when done
Example
Here is a complete example of using the Timer module:
Package Details
Install command (Click to copy)
Version
0.0.3
License
MIT
Safe for commercial use
The package archive does not include its license text; the license is declared in its manifest metadata.
Automated license review — not legal advice.
