When to use "wait a tick"

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

Sqadow

New Member
May 29, 2021
7
0
1
24
So I was reading some skript tutorials and it said: "Please note that while loops don't have a delay, so they are faster than a tick and will crash the server if you are using Minecraft stuff (like blocks) without at least a tick delay: wait a tick"

can someone tell me when to use "wait a tick" I really what to know when to use it sinds my server crashes sometimes bc of this ;-;
 
one example is when creating a gui, i always put "wait a tick" in between the open chest inventory and format slot

Code:
open virtual chest inventory with size 3 to player
wait 1 tick
format gui slot 10 of player with a stick
 
  • Like
Reactions: Sqadow
one example is when creating a gui, i always put "wait a tick" in between the open chest inventory and format slot

Code:
open virtual chest inventory with size 3 to player
wait 1 tick
format gui slot 10 of player with a stick

Thank you so much, do you maybe have some other examples and can you also tell me when you don't have to use it?
 
Another instance where you should use (not necessarily wait 1 tick, but more like 10 ticks) is on loops such as while player is online.

Code:
while player is online:
    # do something
    wait 10 ticks

I don't really understand what you mean by times you don't need to use it. That's basically everytime that you don't use it lol.
I don't have any other times off the top of my head.
 
You don't need to wait a tick every time you open a gui and second "Another instance where you should use (not necessarily wait 1 tick, but more like 10 ticks)" in a while loop you always have to use it!
 
Status
Not open for further replies.