Will a script like this remove a message? I want to make silent commands. But I don't know how, if possible, to remove messages..
game.Players.PlayerAdded:connect(function(Player) local CheckAdmin = emodule.CheckAdmin(Player) if CheckAdmin then Player.Chatted:connect(function(Chat) Chat:Remove() end) end end)
You could use ROBLOX's emotes system or /e, to simulate a "silent" command. Using the substitution function of the string library, you could check if the user's message starts with /e, and proceed accordingly.
I will just edit the snippet you've provided with minor additions to demonstrate just what it is I'm talking about.
game.Players.PlayerAdded:connect(function(Player) local CheckAdmin = emodule.CheckAdmin(Player) if CheckAdmin then Player.Chatted:connect(function(Chat) -- Chat is the string chatted by `Player` -- Check if the first two characters start are '/e' if string.sub(Chat, 1, 2) == '/e' then -- if yes, consider everything after words -- to avoid issues with distinguishing commands -- from chat. Chat = string.sub(Chat, 4) print('secret chat') else print('not-so-secret') end end) end end)