Jump to content

How to format chat with Skript.


Migins

Recommended Posts

M I N E H U T  C O M M U N I T Y  F A Q

HOW TO FORMAT CHAT WITH SKRIPT

REQUIREMENTS: Skript
DIFFICULTY: MEDIUM

Introduction:

For the following tutorial, it is assumed that the reader has a basic knowledge of how to set up a server, install a plugin on said server and join it. It is also assumed that the reader has basic file manipulation skills within the Minehut File Manager, as well a moderate knowledge of the plugin 'Skript'.

The plugin Skript is a great way to modify your server on Minehut. It is incredibly versatile and you can do almost anything with it. An example of this is formatting chat, which I will be focussing on today.

How to format chat:

To format chat, the 'chat format' expression inside of the 'on chat' event can be used. A very basic example of this could entail:

on chat:
  set the chat format to "%player% said %message%"

here we use %player% to represent the player chatting and %message% to represent the message the player sends. You can include color codes such as '&3' or hex codes such as '<##ff00fff>', your chat message can say whatever you want it to say.

You can also use something like this to merge your Skript chat format with your permission plugin's prefix:

on chat:
  if player is op:
    set the chat format to "%player's display name%&f: %message%"
  else:
    set the chat format to "%player's display name%&7: %message%"

Require further assistance?:

If you need more help on this topic, head over to this section of forums, or join our Discord!

📎 https://youtu.be/3avLji1hwtk

 

Compiled by the Minehut Staff Team

Edited by Migins
  • Like 2
  • Thanks 2

Support  July 29, 2020 → November 3, 2020

► Helper November 3, 2020 → February 22, 2021

► Moderator February 22, 2021 → May 17, 2021

 I might not always respond to forum dms, however I am always contactable on discord (mig#0069)

Screen Shot 2020-03-20 at 5.23.33 pm.png

Link to comment
Share on other sites

  • muelr changed the title to How to format chat with Skript.
  • 4 months later...
30 minutes ago, Heheheh9383738 said:

Hey! How can i set own permission for more ranks?

If player has permission: skript.chat.member

doesnt work :c

Try doing this:

if player has permission "skript.chat.member":
  [code]

 

  • Like 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

Thats my code but it wont work :c

So i can reload it without errors but the code doesnt work

on join:
    if player do not have permission "{skript.owner}":
        if player doesn't have permission "{skript.admin}":
            if player doesn't have permission "{skript.staff}":
                if player doesn't have permission "{skript.vip}":
                    set {rank.%player%} to "&7&lMEMBER"
                else:
                    set {rank.%player%} to "&b&lVIP"
            else:
                set {rank.%player%} to "&a&lSTAFF"
        else:
            set {rank.%player%} to "&c&lADMIN"
    else:
        set {rank.%player%} to "&6&lOWNER"

on chat:
    set chat format to "%{rank.%player%}% &8x &f%player% &8» &7%message%"

Edited by Heheheh9383738
Link to comment
Share on other sites

Try this:

on join:
    set {_uuid} to player's uuid
    if player does not have the permission "skript.owner":
        if player does not have the permission "skript.admin":
            if player does not have the permission "skript.staff":
                if player does not have the permission "skript.vip":
                    set {rank.%{_uuid}%} to "&7&lMEMBER"
                else:
                    set {rank.%{_uuid}%} to "&b&lVIP"
            else:
                set {rank.%{_uuid}%} to "&a&lSTAFF"
        else:
            set {rank.%{_uuid}%} to "&c&lADMIN"
    else:
        set {rank.%{_uuid}%} to "&6&lOWNER"

on chat:
    set chat format to "%{rank.%{_uuid}%}% &8x &f%player's displayname% &8» &7%message%"

I have not tested this out but in principal it should work. If there are any errors let me know

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

On 4/16/2021 at 12:36 PM, Heheheh9383738 said:

Thats my code but it wont work :c

So i can reload it without errors but the code doesnt work

on join:
    if player do not have permission "{skript.owner}":
        if player doesn't have permission "{skript.admin}":
            if player doesn't have permission "{skript.staff}":
                if player doesn't have permission "{skript.vip}":
                    set {rank.%player%} to "&7&lMEMBER"
                else:
                    set {rank.%player%} to "&b&lVIP"
            else:
                set {rank.%player%} to "&a&lSTAFF"
        else:
            set {rank.%player%} to "&c&lADMIN"
    else:
        set {rank.%player%} to "&6&lOWNER"

on chat:
    set chat format to "%{rank.%player%}% &8x &f%player% &8» &7%message%"

You don't need to make the permission a variable 

you can make it like 

on chat:
  If player has permission "skript.owner":
	set {rank.%player's uuid%} to "&8&l[&c&lOwner&8&l]"
	set the chat format to "%{rank.%player's uuid%}% %player's display name% &c>> &7%message%"

 

 

Divider clipart letter, Picture #2612096 divider clipart letter

image.png.10b931115c030e1215d1ae007a9d516f.png card

 

Rank - V.I.P

Joined on - Uhh I forgot 

Discord - Xcard#0001

Youtube - Pweas sweakibe :3 ♥️

Free Skripts! - [My website coming soon]

Github - Nothing here yet .-.

 

Rules - READ THEM!                                 Don't click pweas! I said NO!                              SecretJoin :>

Link to comment
Share on other sites

1 hour ago, ShibaTheDoggo said:

You don't need to make the permission a variable 

you can make it like 


on chat:
  If player has permission "skript.owner":
	set {rank.%player's uuid%} to "&8&l[&c&lOwner&8&l]"
	set the chat format to "%{rank.%player's uuid%}% %player's display name% &c>> &7%message%"

 

Bad.

Link to comment
Share on other sites

11 hours ago, Weeeoooooo said:

Bad.

?

 

 

Divider clipart letter, Picture #2612096 divider clipart letter

image.png.10b931115c030e1215d1ae007a9d516f.png card

 

Rank - V.I.P

Joined on - Uhh I forgot 

Discord - Xcard#0001

Youtube - Pweas sweakibe :3 ♥️

Free Skripts! - [My website coming soon]

Github - Nothing here yet .-.

 

Rules - READ THEM!                                 Don't click pweas! I said NO!                              SecretJoin :>

Link to comment
Share on other sites

  • 2 years later...

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