generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why isn't this working?

Previous Thread :: Next Thread 
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
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 is not online. 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
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
30 Nov 2016 07:28 PM
Thank you very much!
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
30 Nov 2016 07:30 PM
So now it works in editor. But why doesn't it work IN-GAME?
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
30 Nov 2016 07:38 PM
In game it doesn't kick or announce anything!
Report Abuse
Ryuzoji is not online. 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
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
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 is not online. 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
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
30 Nov 2016 08:39 PM
:^|

oh
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
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
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
30 Nov 2016 08:45 PM
It doesn't look like it can handle global chat, tho?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image