|
| 30 Nov 2016 07:16 PM |
game.Players.PlayerAdded:connect(function(plr) game.Players.LocalPlayer.Chatted:connect(function(msg) local nMsg = string.lower(msg) for i=1, #bWords do if string.find(nMsg, bWords[i]) then plr:Kick("Cursing is not tolerated in our games. Your ever friendly friend: Administration !") break end end local announce = "A player was kicked for cursing. Please do not make the same mistake, thank you." game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", announce) end) end) ------------------ it kicks player, but doesn't make the "announcement" supposed to be for kicking cussing individuals... |
|
|
| Report Abuse |
|
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
|
| 30 Nov 2016 07:22 PM |
local announce = { ["Text"] = "A player was kicked for cursing. Please do not make the same mistake, thank you.", }
http://wiki.roblox.com/index.php?title=API:Class/StarterGui/SetCore Scroll down to example. The rest of the table values are optional. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Nov 2016 07:30 PM |
| So now it works in editor. But why doesn't it work IN-GAME? |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2016 07:38 PM |
| In game it doesn't kick or announce anything! |
|
|
| Report Abuse |
|
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
|
| 30 Nov 2016 07:38 PM |
Ah, I just read your script. Is this code inside a Script under Workspace?
If so, don't use; game.Players.LocalPlayer.Chatted:connect(function(msg)
use plr.Chatted:connect(function(msg)
Because you already defined plr. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2016 07:42 PM |
Still doesn't work. Here: ---------------------- game.Players.PlayerAdded:connect(function(plr) game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {Title = "Server",Text = "Welcome to our messed up world "..plr.Name,Color = Color3.new(0.5,0,0)}) plr.Chatted:connect(function(msg) local nMsg = string.lower(msg) for i=1, #bWords do if string.find(nMsg, bWords[i]) then plr:Kick("Cursing is not tolerated in our games. Your ever friendly friend: Administration !") end end local announce = {Title = "Server"; Text = "[Server]: "..plr.Name.." has been kicked for cursing, Please learn from this example and not curse. Thank You. ;^)"; Color = Color3.new(0, 0, 0); Font = Enum.Font.Code;} wait() game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", announce) end) end) ---------------------------- |
|
|
| Report Abuse |
|
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
|
| 30 Nov 2016 07:52 PM |
game.Players.PlayerAdded:connect(function(Player) game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {Title = "Server", Text = "Welcome to our messed up world "..Player.Name, Color = Color3.new(0.5,0,0)}) Player.Chatted:connect(function(Message) for i = 1, #bWords do if string.find(string.lower(Message), bWords[i]) then local CacheName = Player.Name Player:Kick("Cursing is not tolerated in our games. Your ever friendly friend: Administration!") local Announce = {Title = "Server"; Text = "[Server]: " ..CacheName.. " has been kicked for cursing, Please learn from this example and not curse. Thank You. ;^)", Color = Color3.new(0, 0, 0), Font = Enum.Font.Code, } end end end) end)
Try this. Sorry if it looks weird to you, but I just rewrote it to the way I format my code. I don't know what's wrong, but I (think) when you kick the player in an actual server, it disconnects the player, causing "plr" to become nil. What I did was cache it's name into "CacheName" instead of using plr.Name. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Nov 2016 08:41 PM |
use this instead of making your own filter which can be easily bypassed anyway
http://wiki.roblox.com/index.php?title=API:Class/Chat/FilterStringAsync |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2016 08:45 PM |
| It doesn't look like it can handle global chat, tho? |
|
|
| Report Abuse |
|
|