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.

Help! (Staff Chat)

Discussion in 'Skript' started by Xletron, Jul 3, 2020.

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

    Xletron Member

    Joined:
    Jul 3, 2020
    Messages:
    4
    Likes Received:
    0
    Skript Version: 2.4.1 (I assume I don't know how to check, it says latest stable release)
    Skript Author: Likewise, I don't know. How do I check???
    Minecraft Version: 1.16.1

    Code:
    Code (Text):
    1. on chat:
    2.     if player has permission "staff.chat":
    3.         if first character of message is "#":
    4.             set {msg} to message
    5.             replace all "# " with "" in {msg}
    6.             cancel event
    7.             loop all players:
    8.                 if loop-player has permission "staff.chat":
    9.                     send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player
    10.     else if player is op:
    11.         if first character of message is "#":
    12.             set {msg} to message
    13.             replace all "# " with "" in {msg}
    14.             cancel event
    15.             loop all players:
    16.                 if loop-player has permission "staff.chat":
    17.                     send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player
    Errors on reload:
    Code (Text):
    1. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 4: set {msg} to message')          
    2.  [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 5: replace all "# " with "" in {msg}')
    3.  [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 6: cancel event')                      
    4. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 7: loop all players:')              
    5. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (xStaffChat.sk, line 8: if loop-player has permission "staff.chat":')                                                        
    6. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 5 tabs (xStaffChat.sk, line 9: send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player')                                        
    7. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 12: set {msg} to message')          
    8. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 13: replace all "# " with "" in {msg}')
    9. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 14: cancel event')                    
    10. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 15: loop all players:')              
    11. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (xStaffChat.sk, line 16: if loop-player has permission "staff.chat":')                                                        
    12. [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 5 tabs (xStaffChat.sk, line 17: send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player')                                                        
    13. [11:05:12 ERROR]: Invalid use of quotes ("). If you want to use quotes in "quoted text", double them: "". (xStaffChat.sk, line 3: if first character of message is "#":')                          
    14. [11:05:12 ERROR]: Invalid use of quotes ("). If you want to use quotes in "quoted text", double them: "". (xStaffChat.sk, line 11: if first character of message is "#":')
    Skript addons:
    SkBee
    Skellett
    TuSKe
    skDragon
    skRayFall

    Tried searching docs
    Tried searching forums
     
  2. Baezor

    Baezor Member

    Joined:
    Jan 3, 2020
    Messages:
    14
    Likes Received:
    6
    You have to use "##" instead of "# ". You use hashtags to comment, so you use 2 in a row to tell it to send them in chat.
     
  3. Xletron

    Xletron Member

    Joined:
    Jul 3, 2020
    Messages:
    4
    Likes Received:
    0
    Oh thank you! I forgot that the # makes all code after it disabled so skript did not read the : at the end. But what I wanted it to do is if there was a # at the start then it would do staffchat so will it still work the same with # like double ## changes to #
     
  4. Detective Vapor

    Joined:
    Jul 2, 2020
    Messages:
    15
    Likes Received:
    0
    Skript knows that ## in a string means just #, so I would just try it and see what happens. It should work if nothing else goes wrong.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...