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

How do you make Server chat messages?

how do you make a server be able to create messages in chat? can you change the color? can this be done locally? can it be deleted after like 5 seconds?

1 answer

✓ Accepted answer

AFAIK, there are two ways to do this. One way is to create a chat bot with chat modules but I never successfully did that.

There is also

StarterGui:SetCore("ChatMakeSystemMessage", dictionary<Variant> configTable)

But this function is intended for local scripts. You would have to use remote events to let the server message all players.

An example:

Server Script

local remote = Instance.new('RemoteEvent')
remote.Name = 'ServerMessageRemote'
remote.Parent = game.ReplicatedStorage

function SendMessage(text)
	remote:FireAllClients(text)
end

game.Players.PlayerAdded:Connect(function(player)
	SendMessage(player.Name .. ' has joined the server')
end)

Local Script (in starter player scripts)

local remote = game.ReplicatedStorage:WaitForChild('ServerMessageRemote')

remote.OnClientEvent:Connect(function(message)
	game.StarterGui:SetCore('ChatMakeSystemMessage', {Text = message})
end)

2 comments

0

so can you do this for one player

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