Help with skript.

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

imHFC

New Member
Aug 22, 2017
7
0
0
28
Hi. Why this SKRIPT isn't working??

Code:
# #############################################
#           UltimateChat by imHFC             #
#               Version 0.0.1                 #
# #############################################
# #
#
#
#
#
#
#
#
#
#
#
#
#
#
#

options:


    #=====================================================================================
    #SETTINGS
    PrefixStaffChat: &b&l[&e&lStaffChat&b&l]
    Prefix: &b&l[&e&lUltimate&c&lChat&b&l]
    PlayerColor: &b
    MessagesColor: &c
    Placeholder: &7>
    #=====================================================================================
  
  
    #=====================================================================================
    #MESSAGES
    NoPerm: &cYou have no permissions&7!
    StaffChatEnabled: &6&lStaffChat &b&lENABLED!
    StaffChatDisabled: &6&lStaffChat &c&lDISABLED!
    UnknownCMD: &aUnknown Command&7.
    Usage1: &cCorrect usage: /uc rl
    #=====================================================================================
  
  
  
  
  
    #=====================================================================================
#Command
command /staffchat [<text>]:
    aliases: /sc, /ac, /adminc, /staffc
    trigger:
  
        if player has permissions "ultimatechat.staffchat":
      
            if text arg is not set:
          
                if {staffchat.%player%} is not set:
              
              
                    set {staffchat.%player%} to true
                  
                  
                    set action bar of player to "{@StaffChatEnabled}"
                  
                  
                else:
              
                    delete {staffchat.%player%}
                  
                  
                    set action bar of player to "{@StaffChatDisabled}"
                  

              
              
              
        else:
            message "{@Prefix} {@NoPerm}" to player
          
          
          
          
command /ultimatechat <text>:
    permission: global.mute
    permission message: &cYou dont have permission for this command!
    aliases: /uc, /uchat, /ultimatec
    trigger:
        if arg is set:

            if text arg is "help":
                message "{@Prefix} &e-*-*-*-*-&6COMMANDS AND HELP&e-*-*-*-*-" to player
                message "{@Prefix} &c- &e/gchat mute &6(Disable chat)" to player
                message "{@Prefix} &c- &e/gchat unmute &6(Enable chat)" to player
                message "{@Prefix} &c- &e/globalchat help &6(Commands and help)" to player
                message "{@Prefix} &e-*-*-*-*-*-*--*-*-*-*-*-*--*-*-*-*-*-"    to player
      
              
            if text arg is "rl" or "reload":
                execute console command "sk reload %script%"
                wait 0.1 second
                message "{@Prefix} Skript Reloaded" to player

            stop
              
            if text arg is not "rl" or "relaod" or "help":
                message "{@Prefix} {@UnknownCMD}"








          
    #=====================================================================================  
      


      
      
      
      

    #=====================================================================================
  
command /chatmute <text>:
    permission: global.mute
    permission message: &cYou have no permissions&7!
    aliases: /cm, /chatm, /cmute
    trigger:
        if arg-1 is set:
            if arg-1 is "on" or "enable" or "unmute":
                set {globalmute} to true
                broadcast "{@Prefix} &aChat has been enabled!"
              
              
            if arg-1 is "off" or "disable" or "mute":
                set {globalmute} to false
                broadcast "{@Prefix} &eChat has been disabled!"
          
              
              
          
on chat:
    if {globalmute} is true:
    else if {globalmute} is false:
        cancel event
      
command /clearchat:
    permission: ultimatechat.clearchat
    permission message: &cYou have no permissions&7!
    aliases: /chatclear, /gchatclear, /globalchatclear, /gss
    trigger:
        loop 150 times:
            broadcast ""
        broadcast "{@Prefix} &aChat cleared!"
      
command /globalchatalert [<text>]:
    permission: sb.perm
    permission message: &cYou have no permissions&7!
    aliases: /sb, /alert, gchatalert
    trigger:
        if arg 1 is set:
            loop all players:
                if loop-player has permission "Xoro.mod":
                    message "{@Prefix} &f%colored arg 1%" to loop-players

  
    #=====================================================================================

          
          
          
          
          
          
          
          
    #=====================================================================================
#Events -Start
on chat:
    if {staffchat.%player%} is true:
        cancel event
        loop all players:
            if loop-player has permissions "staffchat.use":
                message "{@PrefixStaffChat} {@PlayerColor}%player% {@Placeholder} {@MessagesColor}%message%" to loop-players
                message "{@PrefixStaffChat} {@PlayerColor}%player% {@Placeholder} {@MessagesColor}%message%" to console
            else:
                stop
    else:
        stop
      
      
      
      
on quit:
    delete {staffchat.%player%}
    #=====================================================================================

  
  
  
    #=====================================================================================
#Small advertising -Start
on script load:
    message "opened" to the console
    #=====================================================================================

And, console error on reload

Code:
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 1 tab (StaffChat v1.3.sk, line 86: aliases: /uc, /uchat, /ultimatec')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 1 tab (StaffChat v1.3.sk, line 87: trigger:')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 2 tabs (StaffChat v1.3.sk, line 88: if arg is set:')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 90: if text arg is "help":')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 91: message "{@Prefix} &e-*-*-*-*-&6COMMANDS AND HELP&e-*-*-*-*-" to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 92: message "{@Prefix} &c- &e/gchat mute &6(Disable chat)" to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 93: message "{@Prefix} &c- &e/gchat unmute &6(Enable chat)" to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 94: message "{@Prefix} &c- &e/globalchat help &6(Commands and help)" to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 95: message "{@Prefix} &e-*-*-*-*-*-*--*-*-*-*-*-*--*-*-*-*-*-"     to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 98: if text arg is "rl" or "reload":')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 99: execute console command "sk reload %script%"')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 100: wait 0.1 second')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 101: message "{@Prefix} Skript Reloaded" to player')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 103: stop')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 105: if text arg is not "rl" or "relaod" or "help":')
[05:32:44 ERROR]: indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 106: message "{@Prefix} {@UnknownCMD}"')
[05:32:44 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (StaffChat v1.3.sk, line 146: if {globalmute} is true:')
[05:32:45 ERROR]: Required entry 'trigger' is missing in 'command /ultimatechat <text>' (StaffChat v1.3.sk, starting at line 83) (StaffChat v1.3.sk, line 85: permission message: &cYou dont have permission for this command!')
[05:32:45 INFO]: >> StaffChat v1.3 by DampfWaffel.
[05:32:45 INFO]: Loaded 1 script with a total of 4 triggers and 4 commands in 0.32 seconds
[05:32:45 INFO]: [Skript] Encountered 17 errors while reloading all scripts!

What isn't work: It's working just /sc command. /uc rl, /uc help etc don't work!
 
Last edited:
Your error is telling you what is wrong. read through it line by line.
code_language.skript:
indentation error: expected 4 spaces, but found 1 tab (StaffChat v1.3.sk, line 86: aliases: /uc, /uchat, /ultimatec')
"Indentation error" your indentation is incorrect
"expected 4 spaces, but found 1 tab" You cannot have both spaces and tabs in the same skript. 4 spaces = 1 tab
"StaffChat v1.3.sk, line 86" The exact line and skript the problem is located in

Go through the error you posted and resolve each line until you can reload with no more errors
 
.. thanks a lot (i don't know how to solve), but... i need to learn more "skript" (I'm at start).. Thanks anyway.
You either use tabulations (the key above caps lock) or four spaces when indenting code. It's that simple.
Using both causes errors and that's exactly what skript is telling you.
You have to indent code to let skript know what parts of the code you're referencing in conditions and events.
 
Never mind... I don't get it, but.. thanks a lot.
You have too many spaces before your lines. I'm not sure how much simpler I can state it, I'm afraid.
The error is in plain English and tells you precisely what you need to change.
- Too many spaces
- Pick spaces OR Tabs, not both
 
I don't get it... I modified like this
Code:
# #############################################
#           UltimateChat by imHFC             #
#               Version 0.0.1                 #
# #############################################
# #
#
#
#
#
#
#
#
#
#
#
#
#
#
#

options:
    #=====================================================================================
    #SETTINGS
    PrefixStaffChat: &b&l[&e&lStaffChat&b&l]
    Prefix: &b&l[&e&lUltimate&c&lChat&b&l]
    PlayerColor: &b
    MessagesColor: &c
    Placeholder: &7>
    #=====================================================================================
    #=====================================================================================
    #MESSAGES
    NoPerm: &cYou have no permissions&7!
    StaffChatEnabled: &6&lStaffChat &b&lENABLED!
    StaffChatDisabled: &6&lStaffChat &c&lDISABLED!
    UnknownCMD: &aUnknown Command&7.
    Usage1: &cCorrect usage: /uc rl
    #=====================================================================================
    #=====================================================================================
#Command
command /staffchat [<text>]:
    aliases: /sc, /ac, /adminc, /staffc
    trigger:
   
        if player has permissions "ultimatechat.staffchat":
       
            if text arg is not set:
           
                if {staffchat.%player%} is not set:
                    set {staffchat.%player%} to true
                    set action bar of player to "{@StaffChatEnabled}"
                else:
               
                    delete {staffchat.%player%}   
                    set action bar of player to "{@StaffChatDisabled}"
        else:
            message "{@Prefix} {@NoPerm}" to player

command /ultimatechat <text>:
    permission: global.mute
    permission message: &cYou dont have permission for this command!
    aliases: /uc, /uchat, /ultimatec
    trigger:
        if arg is set:
            if text arg is "help":
                message "{@Prefix} &e-*-*-*-*-&6COMMANDS AND HELP&e-*-*-*-*-" to player
                message "{@Prefix} &c- &e/gchat mute &6(Disable chat)" to player
                message "{@Prefix} &c- &e/gchat unmute &6(Enable chat)" to player
                message "{@Prefix} &c- &e/globalchat help &6(Commands and help)" to player
                message "{@Prefix} &e-*-*-*-*-*-*--*-*-*-*-*-*--*-*-*-*-*-"    to player
            if text arg is "rl" or "reload":
                execute console command "sk reload %script%"
                wait 0.1 second
                message "{@Prefix} Skript Reloaded" to player
                stop
            if text arg is not "rl" or "relaod" or "help":
                message "{@Prefix} {@UnknownCMD}"
    #=====================================================================================   
    #=====================================================================================
   
command /chatmute <text>:
    permission: global.mute
    permission message: &cYou have no permissions&7!
    aliases: /cm, /chatm, /cmute
    trigger:
        if arg-1 is set:
            if arg-1 is "on" or "enable" or "unmute":
                set {globalmute} to true
                broadcast "{@Prefix} &aChat has been enabled!"
            if arg-1 is "off" or "disable" or "mute":
                set {globalmute} to false
                broadcast "{@Prefix} &eChat has been disabled!"
               
on chat:
    if {globalmute} is true:
    else if {globalmute} is false:
        cancel event
       
command /clearchat:
    permission: ultimatechat.clearchat
    permission message: &cYou have no permissions&7!
    aliases: /chatclear, /gchatclear, /globalchatclear, /gss
    trigger:
        loop 150 times:
            broadcast ""
        broadcast "{@Prefix} &aChat cleared!"
       
command /globalchatalert [<text>]:
    permission: sb.perm
    permission message: &cYou have no permissions&7!
    aliases: /sb, /alert, gchatalert
    trigger:
        if arg 1 is set:
            loop all players:
                if loop-player has permission "Xoro.mod":
                    message "{@Prefix} &f%colored arg 1%" to loop-players

    #=====================================================================================
    #=====================================================================================
#Events -Start
on chat:
    if {staffchat.%player%} is true:
        cancel event
        loop all players:
            if loop-player has permissions "staffchat.use":
                message "{@PrefixStaffChat} {@PlayerColor}%player% {@Placeholder} {@MessagesColor}%message%" to loop-players
                message "{@PrefixStaffChat} {@PlayerColor}%player% {@Placeholder} {@MessagesColor}%message%" to console
            else:
                stop
    else:
        stop
on quit:
    delete {staffchat.%player%}
    #=====================================================================================
    #=====================================================================================
#Small advertising -Start
on script load:
    message "&7>> &aStaffChat v1.3 by DampfWaffel&7." to the console
    #=====================================================================================
and, still get this error.....
Code:
[Skript] indentation error: expected 4 spaces, but found 1 tab (StaffChat v1.3.sk, line 61: aliases: /uc, /uchat, /ultimatec')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 1 tab (StaffChat v1.3.sk, line 62: trigger:')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 2 tabs (StaffChat v1.3.sk, line 63: if arg is set:')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 64: if text arg is "help":')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 65: message "{@Prefix} &e-*-*-*-*-&6COMMANDS AND HELP&e-*-*-*-*-" to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 66: message "{@Prefix} &c- &e/gchat mute &6(Disable chat)" to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 67: message "{@Prefix} &c- &e/gchat unmute &6(Enable chat)" to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 68: message "{@Prefix} &c- &e/globalchat help &6(Commands and help)" to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 16 spaces (StaffChat v1.3.sk, line 69: message "{@Prefix} &e-*-*-*-*-*-*--*-*-*-*-*-*--*-*-*-*-*-"    to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 70: if text arg is "rl" or "reload":')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 71: execute console command "sk reload %script%"')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 72: wait 0.1 second')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 73: message "{@Prefix} Skript Reloaded" to player')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 74: stop')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 3 tabs (StaffChat v1.3.sk, line 75: if text arg is not "rl" or "relaod" or "help":')
[10:22:08 ERROR]: [Skript] indentation error: expected 4 spaces, but found 4 tabs (StaffChat v1.3.sk, line 76: message "{@Prefix} {@UnknownCMD}"')
[10:22:08 WARN]: [Skript] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (StaffChat v1.3.sk, line 94: if {globalmute} is true:')
[10:22:08 ERROR]: [Skript] Required entry 'trigger' is missing in 'command /ultimatechat <text>' (StaffChat v1.3.sk, starting at line 58) (StaffChat v1.3.sk, line 60: permission message: &cYou dont have permission for this command!')
....
 
For "Noobs English"

You coding all time sometimes with TAB or Space! This is why you get the errors, Youre are allwoed to use TAB OR Space! Btw
_ <= Mean i pressed space
# <= Mean i pressed tab
command:
____trigger:
##send "Ohhhh Do you understand maybe now?"
 
Very kind of you to do it for him. For someone who was having so much trouble with something as basic as spaces, I was going to let him work that one out on his own^^;;
Yea, thats a good point, but i've never actually helped on any threads, only asked questions. I wanted to get one answer in lol
 
Thanks a lot, dude.. But.. i don't see (blind, i know...)what u modified.......
Thanks very much to all for helping me...
And sorry for "trouble" but, is my first skript..
Do you not understand what other people are telling you? Jesus christ. If a line uses ":" at the end, you indent the next line. Tabbing is highly preferable because spacing requires you to space a certain amount of spaces (which requires counting).
 
Do you not understand what other people are telling you? Jesus christ. If a line uses ":" at the end, you indent the next line. Tabbing is highly preferable because spacing requires you to space a certain amount of spaces (which requires counting).
lmao i didnt know you could use tabs i have been using spaces for all of my skripts xD
 
Status
Not open for further replies.