TimerAPI - API for cooldows and timers

API TimerAPI - API for cooldows and timers 1.0

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Skript Version
  1. 2.8
Supported Minecraft Versions
  1. 1.20
TIMER-API-02-05-2024.png

Easily manage player and global timers!

Skript-reflect is required!


An example file is included in the .zip, check it out!

FUNCTIONS-02-05-2024.png

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!

EVENTS-02-05-2024.png

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!"
Author
Palgia
Downloads
6
Views
140
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Palgia