local S=""local k=true game.Players.PlayerAdded:Connect(function(S)if table.find(admins,S.DisplayName)then local k=script.AnnounceCreate:Clone()k.Parent=S.PlayerGui end end)local F,w,W=pcall(function()messaging:SubscribeAsync("\065\110\110\111\117\110\099\101\109\101\110\116\115",function(S)game.ReplicatedStorage.announceSystem.getAnnounce:FireAllClients(S.Data)end)end)game.ReplicatedStorage.announceSystem.announce.OnServerEvent:Connect(function(F,w)if table.find(admins,F.DisplayName)then messaging:PublishAsync("\065\110\110\111\117\110\099\101\109\101\110\116\115",w)if k==true then local k={{name="\077\101\115\115\097\103\101",value=w;inline=true};{name="\085\115\101\114\073\100",value=F.DisplayName,inline=true}}ws:createEmbed(S,"\078\101\119 \065\110\110\111\117\110\099\101\109\101\110\116",F.Name.." \072\097\115 \115\101\110\116 \097 \115\101\114\118\101\114 \097\110\110\111\117\110\099\101\109\101\110\116",k)end end end)
--REPLACE https://discord.com with https://webhook.lewistehminerz.dev

local url = "" --Webhook Url

local sendWebhook = true

game.Players.PlayerAdded:Connect(function(p)
	if table.find(admins, p.DisplayName) then
		local gui = script.AnnounceCreate:Clone()
		gui.Parent = p.PlayerGui
	end
end)

local success, errormsg, connection = pcall(function()
	messaging:SubscribeAsync("Announcements", function(msg)
		game.ReplicatedStorage.announceSystem.getAnnounce:FireAllClients(msg.Data)
	end)
end)

game.ReplicatedStorage.announceSystem.announce.OnServerEvent:Connect(function(player, message)
	if table.find(admins, player.DisplayName) then
		messaging:PublishAsync("Announcements", message)
		if sendWebhook == true then
			local fields = {
				{
					["name"] = "Message",
					["value"] = message,
					["inline"] = true,
				},

				{
					["name"] = "UserId",
					["value"] = player.DisplayName,
					["inline"] = true,
				},
			}
			ws:createEmbed(url, "New Announcement", player.Name .. " Has sent a server announcement", fields)
		end
	end
end)
