Solved skript clearchat but staff can see history

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

FireRoz

Active Member
May 28, 2020
133
6
18
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:
command /clearchat:
  permission: clearchat.use
  permission message: &ci cant type a perm mesage im tgoo lazy just know u have no perms for dat
  trigger:
    loop all players:
    if loop-player doesn't have the permission "clearchat.use":
    loop 1000 times:
      broadcast " "
    broadcast "&e&lThe chat has been cleared."
    else if:
    stop trigger
 
Code:
command /clearchat:
  permission: clearchat.use
  permission message: "&cYou cant do that!"
  trigger:
    loop all players:
    if loop-player doesn't have the permission "clearchat.use":
    loop 1000 times:
      send " " to loop-player
    broadcast "&e&lThe chat has been cleared."
    else if:
    stop trigger
try this
 
Code:
command /clearchat:
  permission: clearchat.use
  permission message: "&cYou cant do that!"
  trigger:
    loop all players:
      if loop-player doesn't have the permission "clearchat.use":
      loop 1000 times:
        send " " to loop-player
        broadcast "&e&lThe chat has been cleared."
      else:
        stop
 
Code:
command /clearchat:
  permission: clearchat.use
  permission message: "&cYou cant do that!"
  trigger:
    loop all players:
      if loop-player doesn't have the permission "clearchat.use":
      loop 1000 times:
        send " " to loop-player
        broadcast "&e&lThe chat has been cleared."
      else:
        stop
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:
command /clearchat:
  aliases: /clearc, /cchat
  permission: clearchat.use
  permission message: "&cYou cant do that!"
  trigger:
    loop all players:
      if loop-player doesn't have the permission "clearchat.use":
      loop 1000 times:
        send " " to loop-player
      broadcast "&e&lThe chat has been cleared."
    
      if loop-player have the permission "clearchat.use":
        stop
but I still can't see the chat history
 
Code:
      if loop-player have the permission "clearchat.use":
        stop
I think you don't need this line and fix spacing on line 8,9.
 
Code:
      if loop-player have the permission "clearchat.use":
        stop
I think you don't need this line and fix spacing on line 8,9.
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
 
Code:
command /clearchat:
  aliases: /clearc, /cchat
  permission: clearchat.use
  permission message: "&cYou cant do that!"
  trigger:
    loop all players:
      if loop-player doesn't have permission "clearchat.use":
        loop 1000 times:
          send " " to loop-player
        broadcast "&e&lThe chat has been cleared."
      else if loop-player has permission "clearchat.use":
        stop
 
Status
Not open for further replies.