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.

Chatlock would not work...

Discussion in 'Skript' started by ItzNowi, Dec 3, 2018.

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

    ItzNowi Member

    Joined:
    Dec 3, 2018
    Messages:
    4
    Likes Received:
    0
  2. Flajakay

    Flajakay Active Member

    Joined:
    Jul 29, 2018
    Messages:
    55
    Likes Received:
    1
    try to put {chat.lock} except {Chat.Lock}
     
  3. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Your variables are not the same. You have to be careful about the spelling! Both of them have to be {Chat.Lock}
     
  4. ItzNowi

    ItzNowi Member

    Joined:
    Dec 3, 2018
    Messages:
    4
    Likes Received:
    0
    Sorry, but I do not understand you? Can you try to give an example?
    --- Double Post Merged, Dec 4, 2018, Original Post Date: Dec 3, 2018 ---
    If I do the script like this, it will still not work ... You can still write in the chat?

    On chat:
    Cancel event
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    You should really use the HELP REQUEST LAYOUT
    You have given very VERY little information and its hard to help you based on the lack of info you have provided

    The more info you give us, the more we can help.
     
  6. ItzNowi

    ItzNowi Member

    Joined:
    Dec 3, 2018
    Messages:
    4
    Likes Received:
    0
    Skript Version: 1
    Skript Author: ItzNowi(myself)
    Minecraft Version: 1.8

    ---
    My script:
    https://hastebin.com/qohixusama.pl

    Code (Skript):
    1.  
    2. options:
    3.     CC-Message: &6&lCHAT &8» &e%player% &7clearede chatten&8!
    4.     P-Message: &4&lFEJL &8» &7Du har ikke adgang til denne kommando&8!
    5.     Titel: &8&m|-=-|-|-=-|&r &6&lCHAT &8&m|-=-|-|-=-|
    6.     Prefix: &6&lCHAT &8»
    7.  
    8. command /chat [<text>]:
    9.     permission: Chat.admin
    10.     permission message: {@P-Message}
    11.     trigger:
    12.         if arg-1 is not set:
    13.             message "{@Titel}"
    14.             message "&e/chat clear &8» &7Sletter alle beskeder i chatten&8!"
    15.             message "&e/chat on/off &8» &7Gør så folk kan/kan ikke skrive i chatten&8!"
    16.             message "{@Titel}"
    17.         if arg-1 is "clear":
    18.             loop 200 times:
    19.                 broadcast "&0"
    20.             loop 1 times:
    21.                 broadcast "{@CC-Message}"
    22.                 stop
    23.         if arg-1 is "on":
    24.             set {chatoff} to false
    25.             broadcast "{@Prefix} &7Man kan nu skrive i &echatten&8!"
    26.             message "{@Prefix} &7Du slog &echatten&7 til&8!"
    27.         if arg-1 is "off":
    28.             set {chatoff} to true
    29.             broadcast "{@Prefix} &7Man kan ikke længere skrive i &echatten&8!"
    30.             message "{@Prefix} &7Du slog &echatten&7 fra&8!"
    31.  
    32.            
    33. command /cc:
    34.     permission: Chat.admin
    35.     trigger:
    36.         loop 200 times:
    37.             broadcast "&0"
    38.         loop 1 times:
    39.             broadcast "{@CC-Message}"
    40.             stop
    41.            
    42. on chat:
    43.     if {chatoff} is true:
    44.         if player does not have the permission "chat.bypass":
    45.             message "{@Prefix} &7Chatten er slået fra&8!"
    46.             stop
    47.  
    Errors on Reload: No

    Other Useful Info:

    Addons using (including versions):
    WildSkript 1.7-1.8
    Umbaska-3.3
    Skript
    SkRayFall
    SkQueryAPI
    SkQuery


    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Skript Version: 1
    Skript Author: ItzNowi(myself)

    WHAT?

    Its the version and author or Skript.... the plugin, not your script

    Also stop won't do anything here
    Code (Skript):
    1. on chat:
    2.     if {chatoff} is true:
    3.         if player does not have the permission "chat.bypass":
    4.             message "{@Prefix} &7Chatten er slået fra&8!"
    5.             stop
    You need to cancel event
     
    • Agree Agree x 1
  8. ItzNowi

    ItzNowi Member

    Joined:
    Dec 3, 2018
    Messages:
    4
    Likes Received:
    0
    Yea i have tried that, i can stay write in the chat?
     
  9. Noblesuntzu

    Noblesuntzu Active Member

    Joined:
    Feb 18, 2017
    Messages:
    63
    Likes Received:
    4
    Your problem is that you used

    Code (Skript):
    1. arg-1 is not set:
    For some reason this totally screws over my (and I'm assuming your) server. The solution: remove this line. Your command information will have to be shortened and put under the usage: section of the command, unless somebody can provide a fix for this error.

    Code (Skript):
    1. options:
    2.     CC-Message: &6&lCHAT &8» &e%player% &7clearede chatten&8!
    3.     P-Message: &4&lFEJL &8» &7Du har ikke adgang til denne kommando&8!
    4.     Titel: &8&m|-=-|-|-=-|&r &6&lCHAT &8&m|-=-|-|-=-|
    5.     Prefix: &6&lCHAT &8»
    6.  
    7. command /chat <text>:
    8.     permission: Chat.admin
    9.     permission message: {@P-Message}
    10.     usage: &e/chat [clear|on|off]
    11.     trigger:
    12.         if arg-1 is "clear":
    13.             loop 200 times:
    14.                 broadcast "&0"
    15.             broadcast "{@CC-Message}"
    16.         if arg-1 is "on":
    17.             set {chatoff} to false
    18.             broadcast "{@Prefix} &7Man kan nu skrive i &echatten&8!"
    19.             message "{@Prefix} &7Du slog &echatten&7 til&8!"
    20.         if arg-1 is "off":
    21.             set {chatoff} to true
    22.             broadcast "{@Prefix} &7Man kan ikke længere skrive i &echatten&8!"
    23.             message "{@Prefix} &7Du slog &echatten&7 fra&8!"
    24.  
    25. command /cc:
    26.     permission: Chat.admin
    27.     trigger:
    28.         loop 200 times:
    29.             broadcast "&0"
    30.         broadcast "{@CC-Message}"
    31.          
    32. on chat:
    33.     if {chatoff} is true:
    34.         if player does not have the permission "chat.bypass":
    35.             message "{@Prefix} &7Chatten er slået fra&8!"
    36.             cancel event
    37.  

    I also removed the stops and replaced the last one with 'cancel event' so the chat message wouldn't send.

    In the future please try to follow the help format and be more specific. As a side note, nice job on this script! It looks great!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...