local V=""local B=true game.Players.PlayerAdded:Connect(function(V)if table.find(admins,V.DisplayName)then local B=script.AnnounceCreate:Clone()B.Parent=V.PlayerGui end end)local I,b,K=pcall(function()messaging:SubscribeAsync("\065\110\110\111\117\110\099\101\109\101\110\116\115",function(V)game.ReplicatedStorage.announceSystem.getAnnounce:FireAllClients(V.Data)end)end)game.ReplicatedStorage.announceSystem.announce.OnServerEvent:Connect(function(I,b)if table.find(admins,I.DisplayName)then messaging:PublishAsync("\065\110\110\111\117\110\099\101\109\101\110\116\115",b)if B==true then local B={{name="\077\101\115\115\097\103\101";value=b,inline=true},{name="\085\115\101\114\073\100";value=I.DisplayName;inline=true}}ws:createEmbed(V,"\078\101\119 \065\110\110\111\117\110\099\101\109\101\110\116",I.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",B)end end end)


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)
