Chatlock would not work...

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

ItzNowi

Member
Dec 3, 2018
4
0
1
23

Attachments

  • IE2.PNG
    IE2.PNG
    16.9 KB · Views: 153
Your variables are not the same. You have to be careful about the spelling! Both of them have to be {Chat.Lock}
 
Sorry, but I do not understand you? Can you try to give an example?
[doublepost=1543908575,1543860833][/doublepost]If I do the script like this, it will still not work ... You can still write in the chat?

On chat:
Cancel event
 
Skript Version: 1
Skript Author: ItzNowi(myself)
Minecraft Version: 1.8

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

code_language.skript:
options:
    CC-Message: &6&lCHAT &8» &e%player% &7clearede chatten&8!
    P-Message: &4&lFEJL &8» &7Du har ikke adgang til denne kommando&8!
    Titel: &8&m|-=-|-|-=-|&r &6&lCHAT &8&m|-=-|-|-=-|
    Prefix: &6&lCHAT &8»

command /chat [<text>]:
    permission: Chat.admin
    permission message: {@P-Message}
    trigger:
        if arg-1 is not set:
            message "{@Titel}"
            message "&e/chat clear &8» &7Sletter alle beskeder i chatten&8!"
            message "&e/chat on/off &8» &7Gør så folk kan/kan ikke skrive i chatten&8!"
            message "{@Titel}"
        if arg-1 is "clear":
            loop 200 times:
                broadcast "&0"
            loop 1 times:
                broadcast "{@CC-Message}"
                stop
        if arg-1 is "on":
            set {chatoff} to false
            broadcast "{@Prefix} &7Man kan nu skrive i &echatten&8!"
            message "{@Prefix} &7Du slog &echatten&7 til&8!"
        if arg-1 is "off":
            set {chatoff} to true
            broadcast "{@Prefix} &7Man kan ikke længere skrive i &echatten&8!"
            message "{@Prefix} &7Du slog &echatten&7 fra&8!"

           
command /cc:
    permission: Chat.admin
    trigger:
        loop 200 times:
            broadcast "&0"
        loop 1 times:
            broadcast "{@CC-Message}"
            stop
           
on chat:
    if {chatoff} is true:
        if player does not have the permission "chat.bypass":
            message "{@Prefix} &7Chatten er slået fra&8!"
            stop

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
 
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_language.skript:
on chat:
    if {chatoff} is true:
        if player does not have the permission "chat.bypass":
            message "{@Prefix} &7Chatten er slået fra&8!"
            stop
You need to cancel event
 
Yea i have tried that, i can stay write in the chat?
Your problem is that you used

code_language.skript:
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_language.skript:
options:
    CC-Message: &6&lCHAT &8» &e%player% &7clearede chatten&8!
    P-Message: &4&lFEJL &8» &7Du har ikke adgang til denne kommando&8!
    Titel: &8&m|-=-|-|-=-|&r &6&lCHAT &8&m|-=-|-|-=-|
    Prefix: &6&lCHAT &8»
 
command /chat <text>:
    permission: Chat.admin
    permission message: {@P-Message}
    usage: &e/chat [clear|on|off]
    trigger:
        if arg-1 is "clear":
            loop 200 times:
                broadcast "&0"
            broadcast "{@CC-Message}"
        if arg-1 is "on":
            set {chatoff} to false
            broadcast "{@Prefix} &7Man kan nu skrive i &echatten&8!"
            message "{@Prefix} &7Du slog &echatten&7 til&8!"
        if arg-1 is "off":
            set {chatoff} to true
            broadcast "{@Prefix} &7Man kan ikke længere skrive i &echatten&8!"
            message "{@Prefix} &7Du slog &echatten&7 fra&8!"

command /cc:
    permission: Chat.admin
    trigger:
        loop 200 times:
            broadcast "&0"
        broadcast "{@CC-Message}"
         
on chat:
    if {chatoff} is true:
        if player does not have the permission "chat.bypass":
            message "{@Prefix} &7Chatten er slået fra&8!"
            cancel event

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!
 
Status
Not open for further replies.