Create a RemoteEvent in ReplicatedStorage and name it "Announcements" Create a localscript in startergui Create a serverscript in serverscriptservice Get the EMS module and put it in serverstorage
MAKE SURE YOU HAVE A TOKEN
game.ReplicatedStorage.Announcements.OnClientEvent:Connect(function(message) | |
game:GetService("StarterGui"):SetCore("SendNotification",{ | |
Title="Announcement", | |
Text=message, | |
Button1="OK", | |
Duration=3, | |
}) | |
end) |
local ems=require(game.ServerStorage.EMS).new("Your Token Here") | |
local admins={["youruseridhere"]=true} | |
ems:Begin(1)() | |
ems:Subscribe("Announcements",function(message) | |
game.ReplicatedStorage.Announcements:FireAllClients(message.author.." says '"..message.content.."'. ") | |
end) | |
game.Players.PlayerAdded:Connect(function(plr) | |
wait(1) | |
print(admins[plr.UserId..""]) | |
if admins[plr.UserId..""] then | |
plr.Chatted:Connect(function(msg) | |
local args=msg:split(" ") | |
print(args) | |
if(args[1]=="!g_announce") then | |
args[1]="" | |
local s="" | |
for i,v in pairs(args) do | |
if v~="" then | |
s=s..(v.." ") | |
end | |
end | |
s:sub(1,s:len()-1) | |
print(s) | |
print(ems:Post("Announcements",s,plr.Name)) | |
end | |
end) | |
end | |
end) |