Creator Only Global Chatting System

Hi Roblox Developers,

I have made a Remote Event called GlobalMessageRE and I have inserted a script into ServerScriptService. How would can I change the script so that only the creator can send global messages?

Here is an example of my script:

local messagingService = game:GetService("MessagingService")

    game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		local splitMsg = string.split(msg, " ")
	
	if splitMsg[1] == "/global" then
		msg = string.gsub(msg, "/global ", "")
		
		local filteredMsg
		
		pcall(function()
			filteredMsg = game:GetService("TextService"):FilterStringAsync(msg, player.UserId)
			filteredMsg = filteredMsg:GetNonChatStringForBroadcastAsync()
		end)
		
		if filteredMsg then
			local messageData = {
				sender = player.Name,
				message = filteredMsg
			}
			
			messagingService:PublishAsync("Chat", messageData)
		end
	end
	end)
end)

messagingService:SubscribeAsync("Chat", function(sendData)
	local data = sendData.Data

	game.ReplicatedStorage.GlobalMessageRE:FireAllClients(data.sender, data.message)
end)

Do you mean the creator of the game, private server etc

I mean how do I make a script that only the creator can send global messages in game.

I believe you would use:

if Player.UserId == game.CreatorId then
-- Code Here
end