-- UserIds of players who have access to chat commands
local Admins = {
112896842,
155350575
}
local Players = game:GetService'Players'
local function IsAdmin(Player)
return table.find(Admins, Player.UserId)
end
local function OnChatted(Player, Message)
if not IsAdmin(Player) then return end
local Args = string.split(Message, " ") -- Split the message into a table of all words
local Command = table.remove(Args, 1) -- Get the first word of the message and remove it from the words table
if Command == "!host" then
print'Host'
local HostGui = game:GetService'ServerStorage'.HostGui:Clone() -- assuming the billboard gui is named "HostGui"
HostGui.Parent = Player.Character.Head
HostGui.Adornee = Player.Character.Head
end
end
local function OnPlayerAdded(Player)
Player.Chatted:Connect(function(Message)
OnChatted(Player, Message)
end)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Is this in the right order?
Put the script in a server script inside ServerScriptService
Alright done what is the next step?
Chat “!host” and it should put the host gui inside of your character
You need to put a textlabel inside of the billboard gui Lol, and then change the Text property of it to like “Host” or something
Oh yeah I am so sorry lol let me do that real quick lol.
You can use Player.Chatted but i prefer ChatService because you can do alot of things with it that you can’t do with Player.Chatted.
Alright once I go to the link what would I do after?
Just read what it tells you to do.
Yeah I just did that and it still did not work when I said “!host” in chat.
Name it “HostGui” not “HostGUI”
Done, Still nothing sadly. Ive done every step and still do not know what is wrong with it lol.
Can you show the hierarchy of the script and the billboard gui
Is your userId in the admin list?
Yes it is hell_ish added it to the coding.
Its HostGui and you named the billboard HostGUi