- Supported Skript Version
- 2.8
- Supported Minecraft Versions
- 1.20
Easily manage player and global timers!
Skript-reflect is required!
An example file is included in the .zip, check it out!
Skript-reflect is required!
An example file is included in the .zip, check it out!
Code:
IMPORTANT INFORMATIONS:
- ALL FUNCTIONS WITH 'ID' AS AN ARGUMENT MUST BE A NAME FOR YOUR COOLDOWN.
- DURATION MUST BE SET AS A TIMESPAN.
- Set a timer for a player
TimerAPI_SetPlayerTimer(player, id, duration)
- Set a global timer
TimerAPI_SetGlobalTimer(id, duration)
- Stop a player timer
TimerAPI_StopPlayerTimer(player, id, duration)
- Stop a global timer
TimerAPI_StopGlobalTimer(id, duration)
- Returns all current timers applied to a player
TimerAPI_AllTimersOfPlayer(player)
- Returns all current global timers
TimerAPI_AllGlobalTimers()
- Checks if a timer is active for a player
TimerAPI_PlayerTimerIsActive(player, id)
- Checks if a global timer is active
TimerAPI_GlobalTimerIsActive(id)
- Returns the time left before a player timer ends
TimerAPI_TimeLeftOfPlayerTimer(player, id)
- Returns the time left before a global timer ends
TimerAPI_TimeLeftOfGlobalTimer(id)
MORE FUNCTIONS ARE AVAILABLE! CHECK IN TimerAPI.sk!
Code:
- When a player timer ends
on player timer end
- event-string = timer's id
- event-plazr = the player
- When a global timer ends
on global timer end
- event-string = timer's id
EXAMPLE:
on global timer end:
event-string is "test"
broadcast "TIMER TEST HAS ENDED!"