[Free] Countdown Script (Standalone)

Free Countdown Script for RedM

Finally show a proper countdown in your rodeo scripts! Whether it’s bull riding, horse racing or lasso competitions, give your players the professional timer experience they deserve :cowboy_hat_face: Or be creative - use this Countdown in your Scripts!

This is a FREE versatile, standalone timer resource for RedM. It provides a clean, modern UI for displaying countdown timers and offers a simple API for integration into other scripts. It features customizable titles, configurable time units, and optional in-game commands (for Developers).

Compatible with any Framework:
:white_check_mark: All Frameworks / STANDALONE


:framed_picture: Preview


:tv: Video Preview


:sparkles: Features

  • Standalone: No framework dependencies
  • Customizable Timers: Start timers with specific amounts, units (seconds, minutes, hours), and optional titles
  • Modern UI: Clean, minimalist, and immersive timer display using Vue 3
  • Sound Notifications: Optional sound playback when a timer is flashing
  • Multiple Timers: Supports display and management of multiple concurrent timers
  • Configurable Commands: In-game commands to start and stop timers can be enabled or disabled
  • Debug Mode: logging for easier troubleshooting, if needed

:wrench: INSTALLATION

  1. Download or clone the bs-countdown resource
  2. Place the bs-countdown folder into your server’s resources directory
  3. Add ensure bs-countdown to your server.cfg file
  4. Restart your server or the resource

:peach: API Usage (Exports)

You can control the timers from your other Lua scripts using these exports.

startTimer(amount, unit, title)

Starts a new timer.

  • Parameters:
    • amount (number): The duration of the timer (e.g., 5, 30).
    • unit (string): The unit of time (‘sec’, ‘min’, ‘hr’ - as defined in Config.TimeUnits).
    • title (string, optional): A custom title for the timer. If nil or empty, defaults to “Countdown”.
  • Returns:
    • success (boolean): true if the timer was started successfully, false otherwise.
    • timerId (number or nil): A unique ID for the timer if successful, otherwise nil. This ID is used to stop the timer.

Example: Starting a timer from another resource

-- client_script.lua in another resource
-- Start a 5-minute timer with a title
local success, timerId = exports['bs-countdown']:startTimer(5, 'min', 'My Custom Event')

if success then
    print('Timer started with ID:', timerId)
else
    print('Failed to start timer.')
end

-- Alternative: Start a 30-second timer without a title (will default to "Countdown")
exports['bs-countdown']:startTimer(30, 'sec')

stopTimer(timerId)

Stops an active timer.

  • Parameters:
    • timerId (number): The ID of the timer to stop (obtained from startTimer).
  • Returns:
    • success (boolean): true if the timer was found and stopped, false otherwise.

Example:

local timerToStop = 1337 -- Assuming timerId 1337 exists
local stopped = exports['bs-countdown']:stopTimer(timerToStop)
if stopped then
    print('Timer ' .. timerToStop .. ' stopped.')
else
    print('Timer ' .. timerToStop .. ' not found or already stopped.')
end

isTimerRunning(timerId)

Checks if a specific timer is currently running.

  • Parameters:
    • timerId (number): The ID of the timer to check.
  • Returns:
    • isRunning (boolean): true if the timer with the given ID is active, false otherwise.

Example:

local checkTimerId = 1
local isRunning = exports['bs-countdown']:isTimerRunning(checkTimerId)
if isRunning then
    print('Timer ' .. checkTimerId .. ' is currently running.')
else
    print('Timer ' .. checkTimerId .. ' is not running.')
end


:handshake: SUPPORT

For support, join our Discord server:

At Blaze Scripts, we’re here to make your life easier - so if you ever run into a hiccup with one of our resources, just reach out and we’ll jump in to help. We strive to support all major frameworks, but on the rare occasion you’re using something outside our usual expertise, we might not be able to provide direct assistance. Either way, we’ll always point you toward resources or guidance to keep your project moving forward.


:fire:FREE DOWNLOAD

GitHub URL : github.com/Blaze-Scripts/bs-countdown

Code is accessible Yes
Subscription-based No
Lines (approximately) 400
Requirements None
Support Yes
1 Like