|
| 06 Jul 2013 01:57 PM |
function LoadedPlayer(Player) function chatted(msg,speaker) function clicked(_) chatlog = { } bad = {"n00b"} if msg then table.insert(chatlog,msg) end for i,v in pairs(chatlog) do if chatlog == bad then speaker:Destroy() end end end end end script.Parent.MouseButton1Down:connect(clicked) Player:connect(chatted) game.Players.PlayerAdded:conect(LoadedPlayer)
No idea why noty working.
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 01:59 PM |
for _, V in pairs(bad) do if v == V the --code end end |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 02:00 PM |
How can I get the speaker to remove the speaker?
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 02:11 PM |
bump
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 05:33 PM |
bumpty
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 05:47 PM |
that just looks like a mess, right ideas in places, but a mess.
What you want to be doing is connecting the playerAdded event to get the player when they load the game, then the chatted event when they speak. From there you dont really need to make a chat log, but you could just check the sent message for any blacklisted words.
local BadWords = {noob}
function Chatted(message, player) if BadWords[message] then player:Destroy() end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) Chatted(msg, player) end) end)
now what I posted up there for the chatted function isn't going to work in most cases. If you typed in "noob" and only that into the chat, it would pick it up and work as expected, but if typed in "Your a noob" into the chat, it wouldn't work.
To make it find words within a string you'll have to do some string pattern magic, I myself aren't very good with them and wont be of much help. But you want to run through the msg and look for them in your BadWords table,if you find one, you :Destroy() the player, if not, then keep looking.
Thats the general idea of how something like this would work. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 05:56 PM |
@who i want to be the player says something, goes to chatlog table and script is in gui imagebutton soi need mousebutton1down but where to put it?
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 06:03 PM |
bump
"That's of course, if you exist upon execution of the script." - KnightmareXD |
|
|
| Report Abuse |
|
|