local E=game:GetService("\080\108\097\121\101\114\115")local Y=game:GetService("\084\101\120\116\083\101\114\118\105\099\101")local O={Id="\077\101\115\115\097\103\101",Aliases={"\109"};Description="\083\104\111\119\115 \097 \109\101\115\115\097\103\101 \116\104\097\116 \099\111\118\101\114\115 \097\108\108 \112\108\097\121\101\114\115\' \115\099\114\101\101\110\115\046";Args={{Type="\115\116\114\105\110\103";Name="\067\111\110\116\101\110\116",Description="\084\104\101 \099\111\110\116\101\110\116 \111\102 \116\104\101 \109\101\115\115\097\103\101 \116\111 \115\104\111\119"}}}function O.RunServer(O,x)local L=Y:FilterStringAsync(x,O.Executor.UserId,Enum.TextFilterContext.PublicChat)local a=O.CmdrAdditions local p=a.Permissions:GetPlayerGroup(O.Executor)for E,Y in pairs(E:GetChildren())do(coroutine.wrap(function()local E=L:GetNonChatStringForUserAsync(Y.UserId)O:SendEvent(Y,"\083\104\111\119\071\108\111\098\097\108\077\101\115\115\097\103\101",{Content=E;Author={Player=O.Executor,Role=p}})end))()end return"\083\101\110\116 \109\101\115\115\097\103\101\046"end return O
local Players = game:GetService("Players")
local TextService = game:GetService("TextService")

local MessageCommand = {
	Id = "Message",
	Aliases = { "m" },
	Description = "Shows a message that covers all players' screens.",
	Args = {
		{
			Type = "string",
			Name = "Content",
			Description = "The content of the message to show"
		}
	}
}

function MessageCommand.RunServer(context, content)
	local filterResult = TextService:FilterStringAsync(content, context.Executor.UserId, Enum.TextFilterContext.PublicChat)
	
	local cmdrAdditions = context.CmdrAdditions
	local role = cmdrAdditions.Permissions:GetPlayerGroup(context.Executor)

	for _, player in pairs(Players:GetChildren()) do
		coroutine.wrap(function()
			local filteredContent = filterResult:GetNonChatStringForUserAsync(player.UserId)
			
			context:SendEvent(player, "ShowGlobalMessage", {
				Content = filteredContent,
				Author = {
					Player = context.Executor,
					Role = role
				}
			})
		end)()
	end

	return "Sent message."
end

return MessageCommand