Hi hello ! 
After years of development, I’m really proud to release my very first script! I couldn’t find any timer/countdown synchronization scripts by players (or maybe my research skills are lacking x’D), so I worked hard to create an advanced and comprehensive script for synchronizing countdowns between players.
You can create two different types of timers:
- Create timers by name. Provide a name, the duration of the timer, and the second at which a close-to-end timer alert sound will ring. Players can join the timer via a command.
- Create timers by zone. Provide the same information as before, then create a zone where the timer will be active. By joining the zone, you will be synchronized with the timer in that zone.
Features
General
- Sync between players, even after a crash or if a new player connect
- Customisable sounds
- Fully configurable
- Optimized
Timer by command
- Timer by name, players can join a timer before or after it starts by using a command
- Only the creator can start or delete their own timers
- The creator can cancel the countdown for all players in the countdown
- Players can cancel the countdown for themselves
- Players can get many timers
Timer by zone
- Every player can create a fully configurable zone and see it during creation
- When the zone is created, a player entering the zone automatically joins the timer
- When a player leaves the zone, the timer stops for them. If they come back to the zone, the timer continues and stays synchronized with the other players and zones.
- If the creator leaves the zone, they still see the timer.
- The creator can cancel the timer for everyone
Sound
- All sounds can be modified
- Sound during the initial countdown
- Can play a tick sound every second or after a configurable second
- Can play a customizable sound after a second chosen by the player when creating the timer
- Every player on the timer listens to the sound
Optimisation
No timer | 0.00ms |
During timer | 0.04ms |
While creating the zone | 0.05ms ~ 0.11ms |
Commands
createTimer | Create a timer players can join with a command |
createTimerZone | Create a timer players can join by entering a zone |
joinTimer | Allow to join a timer, before or after they start |
startTimer | Creator starts the timer for every player who joins |
deleteTimer | Creator deletes the timer. It cancels it if it was already started. If there’s a timer with a zone, it deletes the zone |
cancelTimer | Player can leave the timer. If the creator cancels the timer, it cancels it for every player |
myTimers | See every timer you’ve created |
Configuration
config.lua
Config = {}
Config.Langage = 'fr'
Config.playTickOnSecond = false -- Play a tick sound every second of the timer
Config.playTickOnLastSeconds = true -- Play a tick sound every second during the last phase
Config.playTickSecond = 20 -- If playTickOnLastSeconds is true, play a tick sound at this second
Config.yellowTextSecond = 20 -- After this second, the timer text will turn yellow
Config.orangeTextSecond = 10 -- After this second, the timer text will turn orange
Config.redTextSecond = 5 -- After this second, the timer text will turn red
Config.seePolyzone = true -- If true, the zone remains visible to all players after validation
Config.ZoneColor = {r = 178, g = 4, b = 255} -- Color of the zone
Config.warningCountdown = true -- If true, a countdown will precede the timer start to warn players
Config.warningStartCountdown = 5 -- Number of seconds for the warning countdown
Config.countdownX = 0.5 -- X position on the screen for the timer and countdown
Config.countdownY = 0.05 -- Y position on the screen for the timer and countdown
Config.marker = {
frontPlayer = { -- Marker in front of the player to indicate the zone placement
type = 2,
scale = {x = 0.3, y = 0.2, z = 0.15},
color = {r = 250, g = 0, b = 0, a = 100},
zModifier = 0
},
onGround = { -- Marker on the ground after the player places a point
type = 2,
scale = {x = 0.3, y = 0.2, z = 0.15},
color = {r = 250, g = 0, b = 0, a = 100},
zModifier = 0
}
}
Config.playCustomSoundOnSecond = true -- Allow players to choose the second for playing the custom end sound. Set to false to disallow.
Requirement
ESX
anDialog
GitHub - aymannajim/an_dialogBox: NUI Dialog Box for FiveM [Standalone]
PREVIEW
[ESX] [FIVEM] Astral Timer - The most complet timer/countdown
BUY IT (5€ +tax)
You like it ? Buy it on my shop !
https://boutique.astral-rp.fr/package/6153372
Code is accessible | No (but config and local file) |
Subscription-based | No |
Lines (approximately) | ~ 700 lines |
Requirements | ESX, anDialog, Polyzone |
Support | Yes |
[/quote] |