Help! (Staff Chat)

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

Xletron

Member
Jul 3, 2020
4
0
0
35
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:
on chat:
    if player has permission "staff.chat":
        if first character of message is "#":
            set {msg} to message
            replace all "# " with "" in {msg}
            cancel event
            loop all players:
                if loop-player has permission "staff.chat":
                    send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player
    else if player is op:
        if first character of message is "#":
            set {msg} to message
            replace all "# " with "" in {msg}
            cancel event
            loop all players:
                if loop-player has permission "staff.chat":
                    send "&4[&cStaff&4] &b<%player%> &e%{msg}%" to loop-player

Errors on reload:
Code:
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 4: set {msg} to message')           
 [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 5: replace all "# " with "" in {msg}')
 [11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 6: cancel event')                      
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 7: loop all players:')               
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (xStaffChat.sk, line 8: if loop-player has permission "staff.chat":')                                                         
[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')                                         
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 12: set {msg} to message')           
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 13: replace all "# " with "" in {msg}')
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 14: cancel event')                     
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (xStaffChat.sk, line 15: loop all players:')               
[11:05:11 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (xStaffChat.sk, line 16: if loop-player has permission "staff.chat":')                                                        
[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')                                                         
[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 "#":')                           
[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
 
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.
 
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 #
 
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.
 
Status
Not open for further replies.