Ok, so your a server owner with some staff members, they then ask "Why isnt there a /staffchat?
Well today, I will show you how to make a simple, but effective staff chat. Lets get started with the command:
command /staffchat:
Let's now put in permissions and aliases:
command /staffchat:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
So now, a player who has the permission, sk.sc, will be able to use the command, /staffchat and /sc
Lets now add an argument,
This argument will allow the player to type in their message:
command /staffchat [<text>]:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
We have added the [<text>] argument, which allows the player to type in some text!
Ok so now what?
Well first we need to make a variable storing the [<text>] argument.
This is because when you go to send the message, it wont let you.
So lets add that variable.
Oh wait, you cant forget the trigger!
command /staffchat [<text>]:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
trigger:
set {msg} to arg-1
We have now set the 1st argument to a variable called "msg"
If we wanted to use it, we would want to put it like this %{msg}%
we put the precentages to show skript that this is a variable and not text.
Lets add some "if" statements to make it toggleable.
Pretty much, if you type it in, it will be kept turned on until you disable it by doing the same command again:
command /staffchat [<text>]:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
trigger:
set {msg} to arg-1
if arg-1 is empty:
send "&e&l[STAFF&6&lCHAT] &7&lEnabled Staff Chat" to player
set {sc.%uuid of player%} to true
else:
send "&e&l[STAFF&6&lCHAT] &7&lDisabled Staff Chat" to player
set {sc.%uuid of player%} to false
You see how we now have "if arg-1 is empty".
pretty much skript is looking to see if the player typed in anything or not.
If they didn't, it will enable staff chat and set another variable, {sc.%uuid of player%}. This variable stores the players uuid, which means even if they change names, they will be still in staff chat.
And then we have the "else"
Thats pretty much the easiest toggle method for skript.
Lets now add another "if" statement for if arg-1 is NOT empty:
command /staffchat [<text>]:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
trigger:
set {msg} to arg-1
if arg-1 is empty:
send "&e&l[STAFF&6&lCHAT] &7&lEnabled Staff Chat" to player
set {sc.%uuid of player%} to true
else:
send "&e&l[STAFF&6&lCHAT] &7&lDisabled Staff Chat" to player
set {sc.%uuid of player%} to false
if arg-1 is not empty:
send "&e&l[STAFF&6&lCHAT] &a&l%player% &7&l>> %{msg}%" to all players where [input has permission "sk.sc"]
Okay, so this if statement is pretty confusing but pretty much whats happening is that, the variable we set earlier is now getting used to display the message.
So its sending [STAFFCHAT] 1_x409 >> %{msg}% to all players with the permission "sk.sc"
Lets now make it so that you can send the message when toggled using an "on chat:" event
command /staffchat [<text>]:
aliases: /sc
permission: sk.sc
permission message: "&c&lSorry but you do not have the correct permissions to do this command!"
trigger:
set {msg} to arg-1
if arg-1 is empty:
send "&e&l[STAFF&6&lCHAT] &7&lEnabled Staff Chat" to player
set {sc.%uuid of player%} to true
else:
send "&e&l[STAFF&6&lCHAT] &7&lDisabled Staff Chat" to player
set {sc.%uuid of player%} to false
if arg-1 is not empty:
send "&e&l[STAFF&6&lCHAT] &a&l%player% &7&l>> %{msg}%" to all players where [input has permission "sk.sc"]
on chat:
if {sc.%uuid of player%} is true:
send "&e&l[STAFF&6&lCHAT] &a&l%player% &7&l>> %{msg}%" to all players where [input has permission "sk.sc"]
Its pretty much the same as the one up there. Its just checkng if {sc.%uuid of player%} is true.
You must be logged in to comment
Sept. 29, 2022, 5:53 a.m. - skTank ¶
The 'set {msg} to arg-1' is not needed as you can put '%arg-1%' but otherwise its fine.
Sept. 29, 2022, 3:42 p.m. - 1_x409 ¶
Thanks for your nice opinion :D
Feb. 5, 2023, 3:02 p.m. - skraptmast3r ¶
e
April 14, 2023, 8:56 a.m. - eult ¶
*It's outdated,
The new way to create a staff chat can be found here
*
command /staffchat [[HTML_REMOVED]]: aliases: /sc permission: staff.chat trigger: if arg is set: send formatted "&a%player%: &f%arg%" to all players where [player input has permission "staff.chat"]
April 14, 2023, 8:59 a.m. - eult ¶
Honestly, I don't know why the comment ended up like this, but here's the code.
it's in the examples:
https://skripthub.net/docs/?id=2619
April 18, 2023, 7:33 p.m. - KWAKZ ¶
else: and if arg-1 is not empty:
is the same thing?
so if you want to disable the sc you are forced to send a msg.
you should have the else in the if arg-1 is not set and check if sc.%uuid of player% is true to disable it
also if sc.%uuid of player% is not set and set it to true
June 13, 2023, 10:51 a.m. - sulphinx ¶
Just use if input has permission, you can enable/disable permissions with luckperms.
That would make it more performance efficient.
The code you have right now is very ugly.
Dec. 7, 2024, 3:57 a.m. - xildflyer ¶
Okay, so like, Skript is kinda the worst thing ever if you actually think about it. Like, yeah, it’s "easy to use" or whatever, but that’s exactly the problem. It’s TOO easy. It’s like giving someone who doesn’t know how to code a tool to just write Minecraft plugins without learning anything important. And then they act like they’re actual developers, but they’re NOT. It’s so annoying.
First of all, Skript is super laggy. Every time someone on my server uses a Skript plugin, the TPS (ticks per second, duh) drops to like, 2. It’s like Skript takes your server and says, “Nah, I’m gonna ruin it now.” Real plugins made in Java don’t do that. They’re faster and just better in every way. If Skript was good, it wouldn’t make my server feel like a potato running Windows 98.
Also, Skript is so limited! Like, okay, maybe you can make a basic teleport command or something cool like an auto-miner, but that’s it. What if I want to make something REALLY cool, like a custom mob with 50 abilities or an economy plugin that’s super detailed? Nope, Skript can’t handle it. But if you use Java (which is what real developers use, by the way), you can literally do anything you want. With Skript, you're just stuck making basic stuff that looks like it came from 2012.
And can we talk about how confusing Skript can be? People say it’s “easy to learn,” but nah, it’s just written in this weird, fake coding language that doesn’t make sense half the time. Like, why do you have to write stuff like “on place of diamond block”? Just write the code like a normal human! Real coding languages have rules and structure. Skript feels like someone made it up on a bad day and said, “Here, have fun being frustrated.”
Finally, people who use Skript are kinda annoying (no offense if you do, but like, come on). They always act like their five-line teleport Skript is the greatest thing ever. Meanwhile, Java devs are over here coding entire game modes and fixing actual bugs. Skripters don’t even have to try. They’re like, “Look, I made a whole server with Skript!” but it’s just a laggy mess with 10 commands that break half the time.
In conclusion, Skript is bad. It’s laggy, limited, confusing, and makes people think they’re developers when they’re really not. If you want to make cool plugins or run a good server, just learn Java. It’s harder, sure, but at least you won’t be stuck with Skript, ruining everything. So yeah, Skript is lame, and that’s the truth.
Dec. 7, 2024, 3:58 a.m. - xildflyer ¶
this isn't chatgpt, trust. (FOR REAL!!)