of     1   

Stiiky
#182892567Tuesday, February 02, 2016 8:57 PM GMT

Sorry, I can't get this to run. I don't know whats wrong with it local admins = {"Stiiky"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(message, player) if message:sub(1, 6) == "eatme/" and tableContains(admins, player.Name) then print(message:sub(7)) end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end) whenever I say eatme/bob ingame, nothing happens. No errors in console (F9) or anything.
Stiiky
#182892967Tuesday, February 02, 2016 9:04 PM GMT

bump
seanbenish
#182893346Tuesday, February 02, 2016 9:10 PM GMT

First note that studio sets the player name to "Player." Also, change print(message:sub(7)) to print(message:sub(7,#message)).
Stiiky
#182893387Tuesday, February 02, 2016 9:11 PM GMT

I've ran it ingame, and it doesnt work there.
seanbenish
#182893972Tuesday, February 02, 2016 9:20 PM GMT

Note that it should be in a server script, and that outputs to the server log.
Stiiky
#182894285Tuesday, February 02, 2016 9:26 PM GMT

It is in a server script. It still doesn't work. It doesnt even run, and I have no errors in the console.
seanbenish
#182894571Tuesday, February 02, 2016 9:31 PM GMT

Okay, so I put this code into a serverscript inside of game.ServerScriptService: local admins = {"Player","Stiiky"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(message, player) if message:sub(1, 6) == "|eatme" and tableContains(admins, player.Name) then print (message:sub(7,#message) end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
Stiiky
#182895184Tuesday, February 02, 2016 9:40 PM GMT

Thank you so much!!!

    of     1