Problem With Chatted Event?
I'm trying to make it so that if someone in my list of admins types "/e msg (message)", it will create a new Message object in Workspace, display the message for 2.5 seconds, then destroy it. The problem is, when I try to use it, nothing happens and there is no output.
Here is the code:
07 | function isAdmin(player) |
08 | for _,v in pairs (admins) do |
15 | game.Players.PlayerAdded:connect( function (plr) |
16 | plr.Chatted:connect( function (msg) |
17 | local cmd = string.lower(msg) |
18 | if string.sub(cmd, 1 , 7 ) = = "/e msg " then |
19 | if string.len(cmd) > 7 then |
21 | local m = Instance.new( "Message" ,workspace) |
22 | m.Text = string.sub(msg, 8 ,string.len(cmd)) |