1 | game:GetService( "StarterGui" ):SetCore( "SendNotification" , { |
2 | Text = "test" ; |
3 | Title = "test" ; |
4 | Color = Color 3. new( 0 , 1 , 1 ) |
5 | } ) |
So I've been told that SendNotification is an API, but it hasn't been developed yet.
1 | game:GetService( "StarterGui" ):SetCore( "ChatMakeSystemMessage" , { |
2 | Text = "Welcome, " ..player.Name.. "." ; |
3 | Color = Color 3. new( 0 , 1 , 1 ) |
4 | } ) |
However, there is ChatMakeSystemMessage, which is working. The problem I am running into is that I want it to display globally, meaning that every user can see the message, rather than just the LocalPlayer.
For those of you who don't know, the script has to be a LocalScript & located in the StarterGui. Help would be appreciated.
I would use RemoteEvents for this. When you have a RemoteEvent all you do is call FireAllClients() and the same thing happens to everyone.
LocalScript in StarterGui:
1 | local plr = game.Players.LocalPlayer |
2 | local RE = Instance.new( "RemoteEvent" , game.ReplicatedStorage) |
3 | RE.Name = "Chat" |
4 | RE.OnClientEvent:connect( function (msg, color) |
5 | game:GetService( "StarterGui" ):SetCore( "ChatMakeSystemMessage" , { |
6 | Text = msg or "Hello, world!" ; |
7 | Color = color or Color 3. new( 0 , 1 , 1 ) |
8 | } ) |
9 | end ) |
Script in ServerScriptService:
01 | local RE = game.ReplicatedStorage:WaitForChild( "Chat" ) |
02 |
03 |
04 | -- welcome message |
05 | game.Players.PlayerAdded:connect( function (plr) |
06 | RE:FireAllClients(plr.Name.. " has joined the server." , Color 3. new( 0 , 1 , 0 )); |
07 | end ) |
08 |
09 | game.Players.PlayerRemoving:connect( function (plr) |
10 | RE:FireAllClients(plr.Name.. " has left the server." , Color 3. new( 1 , 0 , 0 ); |
11 | end ) |
12 |
13 | -- general information messages |
14 | local info = { "fav the game!" , "thumb up the game pls!" , "follow my twitter!" } |
15 |
This method might be a bit barbarian, but it should work:
Put a StringValue named "Chat" in Workspace. Put this LocalScript in every Player.
1 | ChatValue = game.Workspace.Chat |
2 |
3 | Chat.Changed:connect( function (property) |
4 | game:GetService( "StarterGui" ):SetCore( "ChatMakeSystemMessage" , { |
5 | Text = Chat.Value; |
6 | Color = color or Color 3. new( 0 , 1 , 1 ) } ) |
7 | end ) |
And then have this Script in workspace too:
1 | game.Players.PlayerAdded:connect( function (player) |
2 | game.Workspace.Chat.Value = "Welcome, " ..player.Name |
3 | end ) |
I might have made me a mistake, if so, please contact me. If you'd need any further explanation, feel free to contact me too.
P.S. Please UpVote, so I can Upvote others! (I don't have 5 Rep yet)