Jump to content

How do you make players talk in chat with a skript?


MQXO
 Share

Recommended Posts

I am pretty new to skripting and i know kinda what im doing with commands but I've never been able to figure this one out;

The commands I'm trying to get are; /forcechat [player] [message] and /forcechatall [message]

I feel as though the parameters are pretty self explanitory but in case you dont get it, /forcechatall would force everyone to say the message inputted in the "[messsage]" field, and /forcechat would make the player entered in the "[player]" field say the message in the "[message]" field.

Link to comment
Share on other sites

This is a fully functioning Skript i made for you.

command /forcechat [<offline player>] [<text>]:
    permission: op
    permission message: &CNo permission!
    usage: &c/forcechat <player> <message>
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                set {_p} to arg-1
                if {_p} is online:
                    make {_p} send message arg-2
                else:   
                    send "&cYou can't sudo a offline player" to player
            else:
                send "&CPlease specify a message!" to player
        else:
            send "&cPlease specify a player!" to player

command /forcechatall [<text>]:
    permission: op
    permission message: &CNo permission!
    usage: &c/forcechatall
    trigger:
        if arg-1 is set:
            loop all players:
                make loop-player send message arg-1
        else:
            send "&cPlease specify a message!" to player

 

  • Like 2

 

Active Minehut Player since 2016

Advanced at Skript - Know a lot about running a server 

If you need help with anything contact me @ KJPAKA#0001

 

Link to comment
Share on other sites

1 hour ago, KJPAKA said:

This is a fully functioning Skript i made for you.


command /forcechat [<offline player>] [<text>]:
    permission: op
    permission message: &CNo permission!
    usage: &c/forcechat <player> <message>
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                set {_p} to arg-1
                if {_p} is online:
                    make {_p} send message arg-2
                else:   
                    send "&cYou can't sudo a offline player" to player
            else:
                send "&CPlease specify a message!" to player
        else:
            send "&cPlease specify a player!" to player

command /forcechatall [<text>]:
    permission: op
    permission message: &CNo permission!
    usage: &c/forcechatall
    trigger:
        if arg-1 is set:
            loop all players:
                make loop-player send message arg-1
        else:
            send "&cPlease specify a message!" to player

 

Thanks, I'm 100% gonna study this so i can figure out what the hell I'm doing.

Link to comment
Share on other sites

Alright, if you have any questions feel free to contact me.

 

Active Minehut Player since 2016

Advanced at Skript - Know a lot about running a server 

If you need help with anything contact me @ KJPAKA#0001

 

Link to comment
Share on other sites

they made that way to hard this is very simple:

command /chat <player> <text>:

    permission: chat

    trigger:

        make arg-1 say arg-2                                                                                                                                    

Link to comment
Share on other sites

What i did was i made it so it checked if it was set and other stuff to make it fancy. Also, use [<offline player>] and [<text>] instead. But yes that would work as well. I also made it check if the player was online etc.

Edited by KJPAKA

 

Active Minehut Player since 2016

Advanced at Skript - Know a lot about running a server 

If you need help with anything contact me @ KJPAKA#0001

 

Link to comment
Share on other sites

2 hours ago, KJPAKA said:

What i did was i made it so it checked if it was set and other stuff to make it fancy. Also, use [<offline player>] and [<text>] instead. But yes that would work as well. I also made it check if the player was online etc.

you could've just not used optional arguments, have put `usage: &c/forcechat (player) (message)` before the trigger and made it use a player argument instead of an offlineplayer argument

VIP since January 7th, 2020

Support since September 19th, 2020

Helper since November 3rd, 2020

Moderator since March 8th, 2021

unknown.png

5.png.e14b1bf83edf0ac2edc1bfb822177184.png

image.png.fe30b7b2c0be5a541ba4ed2187b23030.png

Link to comment
Share on other sites

I use offline player because then you can tab the name.

 

Active Minehut Player since 2016

Advanced at Skript - Know a lot about running a server 

If you need help with anything contact me @ KJPAKA#0001

 

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
 Share



×
×
  • Create New...