Jump to content

Recommended Posts

Hi,

I am making an Anonymous skript for my server, So when a player has Anonymous mode activated their name will appear like "&0Anonymous > %message" in chat.

I seem to have done something incorrect but I can't find any errors.

If you know it'll be very useful. Thanks 😄

Link to post
Share on other sites

When a player activates anonymous mode, set a variable to true. Then when they chat, if the variable is true, set the chat format to the thing you said.

 

[VIP] - 7/27/2020
Support - 7/08/2020
Senior Support - 8/02/2020


image.png.2111009afbd8bef10966ba9ede35a199.pngimage.png.70849a9b84e0347ce107b8e3eaee312c.png

Great website if you need help with any plugins or answers to commonly asked questions - https://minehut.xyz/

IGN: _Tarna_
Discord: Tarna256#867

Link to post
Share on other sites
1 minute ago, RealFTG said:

That's exactly what I did. But my name is still the same. Here's the skript. Could you have a look at it?

anon.sk 480 B · 0 downloads

For some reason, that file is not loading for me. Can you just send the code in here or a pastebin.com.

 

[VIP] - 7/27/2020
Support - 7/08/2020
Senior Support - 8/02/2020


image.png.2111009afbd8bef10966ba9ede35a199.pngimage.png.70849a9b84e0347ce107b8e3eaee312c.png

Great website if you need help with any plugins or answers to commonly asked questions - https://minehut.xyz/

IGN: _Tarna_
Discord: Tarna256#867

Link to post
Share on other sites

Sure.

 

 

 

 

 

command /anon <text>:
    trigger:
        if arg 1 is "on":
            set {chat.anon.%player%} to true
            send "&aAnonymous mode is on."
        if arg 1 is "off":
            set {chat.anon.%player%} to false
            send "&aAnonymous mode is off."
            
            
on chat:
    if {chat.anon.%player%} is true:
        set chat format to "&0Anonymous&r > %message%"
    if {chat.anon.%player%} is false:
        set chat format to "%player% > %message%"

Link to post
Share on other sites

Heya! In the future, try to use "else if" statements:

on chat:
    if {chat.anon.%player%} is true:
        set chat format to "&0Anonymous&r > %message%"
    else if {chat.anon.%player%} is false:
        set chat format to "%player% > %message%"

 

Anyways, regarding your issue, I would recommend:
Perhaps you should make it a toggle feature.

command /anon [<text>]:
	trigger:
		if {chat.anon.%player%} is not set:
			set {chat.anon.%player%} to true
			send "Enabled anonymous mode!"
		else:
			delete {chat.anon.%player%}
			send "Disabled anonymous mode!"

If you do try this alternative, you must use this code:

on chat:
    if {chat.anon.%player%} is true:
        set chat format to "&0Anonymous&r > %message%"
    else:
        set chat format to "%player% > %message%"

Hope this helps!

❤️ 😄 

Edited by AWorthySon
  • Like 1

 

image.png.e46e91961f1d6d4604a6e5f3dcb5a2bd.png

unknown.pngunknown.png

Link to post
Share on other sites

Ahhh... Ok.

That did help, I found out what was causing the issue. It was because I forgot I had another chatformat skript to remove the world name from chat messages. Thanks a lot though for the help guys. 😄

Link to post
Share on other sites
39 minutes ago, RealFTG said:

Ahhh... Ok.

That did help, I found out what was causing the issue. It was because I forgot I had another chatformat skript to remove the world name from chat messages. Thanks a lot though for the help guys. 😄

Oh nice. Just put all the chat format things in one on chat event.

 

[VIP] - 7/27/2020
Support - 7/08/2020
Senior Support - 8/02/2020


image.png.2111009afbd8bef10966ba9ede35a199.pngimage.png.70849a9b84e0347ce107b8e3eaee312c.png

Great website if you need help with any plugins or answers to commonly asked questions - https://minehut.xyz/

IGN: _Tarna_
Discord: Tarna256#867

Link to post
Share on other sites

By the way to remove the world name from chat messages you can do /mv config prefixchat false, and you should always only have one event of each type (unless you're planning on having a feature that ignores what the other events do), as that can cause issues

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...