Simple stopwatch

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

FEDX_sk

Member
Jul 25, 2017
14
0
0
Hi all, I created this simple stopwatch and I had come a doubt regarding whether it could cause lag to the server and if there is a better way to create it.
This is the code:
Code:
On skript load:
     set {time} to 0
command /stopwatch [<text>]:
   trigger:
      if arg-1 is "start":
        set {stopwatch} to true
      if arg-1 is "stop":
        set {stopwatch} to false
      if arg-1 is "show":
        send "&b{time}" to player

every second:
  if {stopwatch} is "true":
    add 1 to {time}
    stop

Sorry for my english.
Thanks
 
Nah that shouldn't really lag. Ik people say not use every second or every tick but ive never had a problem.

The only other way would be to have a while loop then wait 1 second at the end of it which may be slightly better than a periodical but probably not noticeably
 
Status
Not open for further replies.