1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved skript clearchat but staff can see history

Discussion in 'Skript' started by FireRoz, Nov 3, 2020.

Thread Status:
Not open for further replies.
  1. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    6
    heyo
    I'm trying to make a clearchat skript, but for example, if staff clear the chat they can't see who broke the rules.
    So they cant mute him.
    I want staff with the permission "clearchat.use" to be able to see the chat even after it's been cleared.
    Here's what I'm working with:
    Tuske, Skript, wolvsk
    Here's the code:
    Code (Text):
    1. command /clearchat:
    2.   permission: clearchat.use
    3.   permission message: &ci cant type a perm mesage im tgoo lazy just know u have no perms for dat
    4.   trigger:
    5.     loop all players:
    6.     if loop-player doesn't have the permission "clearchat.use":
    7.     loop 1000 times:
    8.       broadcast " "
    9.     broadcast "&e&lThe chat has been cleared."
    10.     else if:
    11.     stop trigger


     
  2. Best Answer:
    Post #8 by Time4Games, Nov 3, 2020
  3. PolduZ

    PolduZ Member

    Joined:
    Oct 2, 2020
    Messages:
    23
    Likes Received:
    1
    Code (Text):
    1. command /clearchat:
    2.   permission: clearchat.use
    3.   permission message: "&cYou cant do that!"
    4.   trigger:
    5.     loop all players:
    6.     if loop-player doesn't have the permission "clearchat.use":
    7.     loop 1000 times:
    8.       send " " to loop-player
    9.     broadcast "&e&lThe chat has been cleared."
    10.     else if:
    11.     stop trigger
    try this
     
  4. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    196
    Likes Received:
    4
    Code (Text):
    1. command /clearchat:
    2.   permission: clearchat.use
    3.   permission message: "&cYou cant do that!"
    4.   trigger:
    5.     loop all players:
    6.       if loop-player doesn't have the permission "clearchat.use":
    7.       loop 1000 times:
    8.         send " " to loop-player
    9.         broadcast "&e&lThe chat has been cleared."
    10.       else:
    11.         stop
     
  5. PolduZ

    PolduZ Member

    Joined:
    Oct 2, 2020
    Messages:
    23
    Likes Received:
    1
    ah ty for correcting me :emoji_grinning:
     
  6. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    6
    doesn't work.
    -_- idk why but it just repeats itself like it loops 1000 times
    &e&lThe chat has been cleard.
    and I cant see chat history yet.
    here's the code without errors:
    Code (Text):
    1. command /clearchat:
    2.   aliases: /clearc, /cchat
    3.   permission: clearchat.use
    4.   permission message: "&cYou cant do that!"
    5.   trigger:
    6.     loop all players:
    7.       if loop-player doesn't have the permission "clearchat.use":
    8.       loop 1000 times:
    9.         send " " to loop-player
    10.       broadcast "&e&lThe chat has been cleared."
    11.    
    12.       if loop-player have the permission "clearchat.use":
    13.         stop
    but I still can't see the chat history
     
  7. MeHow

    MeHow Active Member

    Joined:
    Feb 6, 2017
    Messages:
    140
    Likes Received:
    13
    Code (Text):
    1.       if loop-player have the permission "clearchat.use":
    2.         stop
    I think you don't need this line and fix spacing on line 8,9.
     
  8. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    6
    this line is the purpose of the skript.
    Staff being able to see the messages before staff has cleared the chat.
    It doesn't say any errors with the spaces.
    So I don't know how to fix it
     
  9. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    196
    Likes Received:
    4
    Code (Text):
    1. command /clearchat:
    2.   aliases: /clearc, /cchat
    3.   permission: clearchat.use
    4.   permission message: "&cYou cant do that!"
    5.   trigger:
    6.     loop all players:
    7.       if loop-player doesn't have permission "clearchat.use":
    8.         loop 1000 times:
    9.           send " " to loop-player
    10.         broadcast "&e&lThe chat has been cleared."
    11.       else if loop-player has permission "clearchat.use":
    12.         stop
     
    • Winner Winner x 3
Thread Status:
Not open for further replies.

Share This Page

Loading...