How to make a Host command

Hello! So, I’m making a training center, right, and I want to make a command that when a user, who is a certain rank in the group, says it, it says on everyones screen:

Your host is Username who said the command. Your session will start soon.

THANK YOU! :slight_smile:

(I know basic LUA btw, so if you don’t want to type out a full script thats fine if its long)

3 Likes

Do you need the script with the commands included, checks for person’s rank, and does what it needs after? Also you’ll need a gui ready

2 Likes

To accomplish this you will have to start by making a new screen gui and filling it with the UI you want to pop up, make sure to parent a text label to directly the starter gui.

After this you’ll make a script in SSS that checks when a player chats by going on dev hub and looking up a chatted event.

After you make the event inside the event you will put string:lower(msg) (or something like that) that makes the message in lowercase.

After it’s set to lowercase check if the new lowercase message is whatever your host command is checking for, such as “;host.” Make sure everything is lowercase or it won’t work! After that check you need to check their rank in group by doing:

if player:GetRankInGroup(groupID) >= requiredRank then

Once your done with that you’ll have to make a remote event in rep storage. Then you will go in your event and after checking if it’s the command you will fire the remote event on all clients.

Once your done with this you should make a local script in your text label. Inside the script you will check when the remote event gets fired, and when it does you will make the screen gui enabled.

In the event you will want to change the text label with this code:

local duration = 3
local msg = “ is the new host!”

script.Parent.Text = player..msg
task.wait(duration)
script.Parent.Text = “”

After inserting this code you will make the starter gui enabled false once more. It should now all be working perfectly!

If you have any questions send me your code and I can proof read it :smiley:

Edit:
Re-read it, I’ve added the rank check!

2 Likes

Yes. This worked like the chefs kiss. Thank you so much! :slight_smile:

3 Likes

Another solution for anyone else who wants to do something like this:

self advertising lol

Get KeeAdmin and put it into your game, and simply follow the Packages section, which tells you how to make your own commands, and follow the tutorial from there.

2 Likes

That isn’t a solution, that’s just advertising your basic admin system that was created with minuscule commands.

2 Likes

Partially correct. I created KeeAdmin to help people with administrative needs. This accomplishes that. Even with that said, this isn’t the first time people have self-advertised on the Devforum. Plus, the creator of this topic told me to post my solution.

2 Likes