✓ Accepted answer
Events/Handy tools
To create such message, we'll use ChatMakeSystemMessage. This creates a message in the chat system. Second, PlayerAdded event, this event fires when a player joins the server.
game.Players.PlayerAdded:connect(function(player)
return player
end)
The event also includes a Player argument.
Responsibilities and Consequences
Although these events/tables would help, ChatMakeSystemMessage can only work if used in a LocalScript using a Script would cast an error, same with PlayerAdded, with the exception that it doesn't error, it just doesn't corporate. A RemoteEvent/RemoteFunction would assist.
Created Code
local remote = Instance.new("RemoteEvent",game.Workspace)
remote.Name = "RE"
game.Players.PlayerAdded:connect(function(Player)
remote:FireServer(Player)
end)
workspace:WaitForChild("RE").OnServerEvent:connect(function(Player)
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
Text = "[Server]: "..Player.Name.." has Joined the Server";
Color = Color3.new(0,0,0);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
})
end)
1 comment
I like this question