Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make the game chat in the chat gui?

so what i mean by that is i am making admin commands and when the player i want gets kicked i want the game in the chat box to display something like player_name has successfully been kicked

1 comment

0

you can detect when an admin chats, then make a remote event to fire once a player is kicked, then make a script that handles once the player is kicked and make the game display a message that can say "player has been kicked" you can connect the player's name in the remote event when it is fired and do this: playerName.." has been kicked."

1 answer

✓ Accepted answer

You can make use of :SetCore(). This is a function of StarterGui so you cannot use it on the server. To show the message to everyone you will have to use FireAllClients.

From your server script:

-- Put admin-has-chatted logic above

--You will need a remoteevent to fire all clients.
local remote = 

--Define the properties you want the message to have
local properties = {
	Text = player_name.." has been kicked.";
	Font = Enum.Font.Arial;
	FontSize = Enum.FontSize.14;
	Color = Color3.fromRGB(255,255,255);
}

remote:FireAllClients(properties)

From your localscript, use ChatMakeSystemMessage to process the properties and send the message.

local remote = 
local StarterGui = game:GetService("StarterGui")

remote.OnClientEvent:Connect(function(properties)
	StarterGui:SetCore("ChatMakeSystemMessage", properties)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.