Jump to content

Anonymous skript


Bucr8363b

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

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

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

Link to comment
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.

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

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

Link to comment
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 comment
Share on other sites

That looks like it should be working. Make sure the variable is true for you.

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

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

Link to comment
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 comment
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.

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

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

Link to comment
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 comment
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...