need help with chat 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.

ComPieter

New Member
Aug 14, 2019
8
0
0
23
dont know why this isn't working cause i am bad at skript :/ i want to be able to ignore an player in /msg and in chat at the same time and also have an player list of ignored players

i use this for an anarchy server where players need to be able to mute other players
 

Attachments

  • chat.sk
    2.1 KB · Views: 174
Last edited:
thanks but still have an isseu with /msg


if arg-1 is set:
if {ignore::%uuid of player%::*} is sender:
stop
else:
if arg-2 is set:
set {message.%player%} to arg 1
set {message.%arg 1%} to player
send "&bFrom: &a%player%&r &7> &6%arg 2%" to arg 1
send "&bTo: &a%arg 1%&r &7> &6%arg 2%" to player
[doublepost=1565826435,1565824834][/doublepost]this doesn't work of course:


if arg-1 is set:
loop recipients:
if {ignore::%loop-player's uuid%::*} is sender:
remove loop-player from recipients
[doublepost=1565827151][/doublepost]
Mostly pseudo code, but should work. Fix the errors if any.

code_language.skript:
options:
    ERROR_MESSAGE = &c[ M.A.L.I.A ] - An error occurred while trying to execute the command.

on load:
    if file "plugins/Malia/chat/config.yml" doesn't exist:
        create file "plugins/Malia/chat/config.yml"

on join:
    if file "plugins/Malia/chat/players/%player's uuid%.yml" doesn't exist:
        create file "plugins/Malia/chat/players/%player's uuid%.yml"

command /uuid [<offline player>]:
    trigger:
        if arg-1 is not set:
            send "%{@ERROR_MESSAGE}% &7&o(Usage: /uuid <player>)" to player
            stop
        send "&a%arg-1%'s UUID: &7%arg-1's uuid%"

command /ignore [<offline player>]:
    trigger:
        if arg-1 is not set:
            send "%{@ERROR_MESSAGE}% &7&o(Usage: /ignore <player>)" to player
            stop
        add "%arg-1's uuid%" to {LIST::IGNORED::%player%::*}
        set yml value "%arg-1's uuid%" in "plugins/Malia/chat/players/%player's uuid%.yml" to true

on chat:
    loop all players:
        loop {LIST::IGNORED::%loop-player%::*}:
            if {LIST::IGNORED::%loop-player%::*} contains %loop-index's uuid%:
                cancel event

TODO: Load ignored people from the file

Edit:
On your code, you're missing intendation, anyways isn't this line the issue?
code_language.skript:
if {ignore::%loop-player's uuid%::*} is player:
Try with "is sender"


i tried it but got many errors probbaly need an addod but dont know what for addon


[23:58:18 ERROR]: [Skript] 'ERROR_MESSAGE = &c[ M.A.L.I.A ] - An error occurred while trying to execute the command.' is not an entry (like 'name : value') (chat2.sk, line 2: ERROR_MESSAGE = &c[ M.A.L.I.A ] - An error occurred while trying to execute the command.')
[23:58:18 ERROR]: [Skript] can't understand this condition: 'file "plugins/Malia/chat/config.yml" doesn't exist' (chat2.sk, line 5: if file "plugins/Malia/chat/config.yml" doesn't exist:')
[23:58:18 ERROR]: [Skript] can't understand this condition: 'file "plugins/Malia/chat/players/%player's uuid%.yml" doesn't exist' (chat2.sk, line 9: if file "plugins/Malia/chat/players/%player's uuid%.yml" doesn't exist:')
[23:58:18 ERROR]: [Skript] undefined option {@ERROR_MESSAGE} (chat2.sk, line 15: send "%{@ERROR_MESSAGE}% &7&o(Usage: /uuid <player>)" to player')
[23:58:18 ERROR]: [Skript] undefined option {@ERROR_MESSAGE} (chat2.sk, line 22: send "%{@ERROR_MESSAGE}% &7&o(Usage: /ignore <player>)" to player')
[23:58:18 WARN]: [Skript] the UUID of the 1st argument is already a text, so you should not put it in one (e.g. the UUID of the 1st argument instead of "%the UUID of the 1st argument%") (chat2.sk, line 24: add "%arg-1's uuid%" to {LIST::IGNORED::%player%::*}')
[23:58:18 ERROR]: [Skript] Can't understand this condition/effect: set yml value "%arg-1's uuid%" in "plugins/Malia/chat/players/%player's uuid%.yml" to true (chat2.sk, line 25: set yml value "%arg-1's uuid%" in "plugins/Malia/chat/players/%player's uuid%.yml" to true')
[23:58:18 ERROR]: [Skript] can't understand this condition: '{LIST::IGNORED::%loop-player%::*} contains %loop-index's uuid%' (chat2.sk, line 30: if {LIST::IGNORED::%loop-player%::*} contains %loop-index's uuid%:')
 

Attachments

  • chat.sk
    2.1 KB · Views: 155
thank you but i am trying for a while now and it just won't work i am losing it i fixed most of the problems in your skript but it's again the loop that doesn't work

Update/Edit: it works now and i have merged for the most part your skript with mine and made some adjustments
also the yaml value works now but i need an ways to read it its probbaly this i guess

if yaml value of "%arg-1's uuid%" of file "plugins/solito/chat/players/%player's uuid%.yml" is true:
# do the rest i guess but correct me if i am wrong
 

Attachments

  • chat.sk
    3.2 KB · Views: 164
Last edited:
yeah i does but i have an problem skUtilities has also the same yaml (almost) and that conflicts with skript yaml
also i need to find an way to hide chat completely with /chattoggle
 

Attachments

  • chat.sk
    4.4 KB · Views: 154
thanks part of it work tho
this part doesn't also i get an error when using yaml for my telltogle why idk

if {CHAT::MUTED::%recipients%} is true:
cancel event
 

Attachments

  • 2019-08-19_00.09.31.png
    2019-08-19_00.09.31.png
    327.2 KB · Views: 180
  • chat.sk
    5.2 KB · Views: 171
i think it's this one but i am not sure
set yml value "chat-mute" of file "plugins/solito/chat/players/%player's uuid%.yml" to true

or it's this one if yaml value "tell-mute" of file "plugins/solito/chat/players/%player's uuid%.yml" is true
 
Status
Not open for further replies.