Solved Loop infinite

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

bobby

Active Member
Jan 28, 2017
61
0
6
26
Skript 2.2
Mc version: 1.10.2

Hey! I'm trying to make it so if a player does /say it will do a loop, spamming /say Drill until the player runs the command again? How could I do this?
 
You could do something like this:
code_language.skript:
command /say [<text>]:
  trigger:

    if argument is set:
  
      set metadata "saying" of player to true #Using metadata to override the creation of useless variables in the database
    
      while metadata "saying" of player is set:     
        send argument
        wait a tick #You're better waiting 1-3 ticks or the server will crash.
  
    else:
    
      clear metadata "saying" of player

Needs Skellett.
 
  • Like
Reactions: bobby
You could do something like this:
code_language.skript:
command /say [<text>]:
  trigger:

    if argument is set:
 
      set metadata "saying" of player to true #Using metadata to override the creation of useless variables in the database
   
      while metadata "saying" of player is set:    
        send argument
        wait a tick #You're better waiting 1-3 ticks or the server will crash.
 
    else:
   
      clear metadata "saying" of player

Needs Skellett.
Thanks!