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 » Scripting Helpers
Home Search
 

Re: Chat Help!

Previous Thread :: Next Thread 
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
22 Nov 2013 05:19 PM
I want to do a function every time I say a special sentence. ( This sentence includes spaces )

Say the sentence was: "I like cookies."

I want it so whenever I say that it does a function. Help?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Nov 2013 05:24 PM
Here


game.players.PlayerAdded:connect (function (PlayerObject)
player.Chatted:connect (function (msg)
if player.msg == "I like cookies"
then
player:destroy ()
end)
end)


if u say I like cookies, u get kicked
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Nov 2013 05:25 PM
Coool! Are you the maker of the cookie game?
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
22 Nov 2013 05:26 PM
Yes.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
22 Nov 2013 05:31 PM
"game.players.PlayerAdded:connect (function (PlayerObject)
player.Chatted:connect (function (msg)
if player.msg == "I like cookies"
then
player:destroy ()
end)
end)
"


SO. UGLY.

Plus that would not even work.




game.players.PlayerAdded:connect(function(Player)
Player.Chatted:connect(function(Message)
if Message == "I like cookies" then
player:Destroy()
end
end)
end)
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
22 Nov 2013 05:32 PM
game.Players.PlayerAdded:connect(function(Player)
Player.Chatted:connect(function(Message)
if Message == "I like cookies" then
player:Destroy()
end
end)
end)



Didn't capitalize 'Players'

Meh bad.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Nov 2013 05:33 PM
red line huh? try this, I forgot something.

game.players.PlayerAdded:connect (function (PlayerObject)
player.Chatted:connect (function (msg)
if player.msg == "I like cookies" then -- forgot end
player:destroy ()
end -- frogot end
end)
end)


ABOVE IF MINE IS SO UGLY, WHY DID YOU COPY IT?
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
22 Nov 2013 05:34 PM
That still won't work.

The reason it was ugly was because of the way you set it up.

I changed it and corrected it.

Learn, youngling.
Report Abuse
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
22 Nov 2013 05:35 PM
Kev the problem's your argument
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
22 Nov 2013 05:41 PM
Still won't work.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 05:44 PM
game.players.PlayerAdded:connect (function(player)
player.Chatted:connect (function(msg)
if msg:lower() == "i like cookies" then
--Whatever.
end
end)
end)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Nov 2013 05:48 PM
above that wont help uless he's saying it wrong
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 05:49 PM
I also fixed all your errors.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Nov 2013 05:55 PM
Capitalize the p in players.

Game.Players
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 05:57 PM
*Suicides*
Report Abuse
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
22 Nov 2013 06:11 PM
*suicides after homicides*

p = game.Players:GetChildren()
for i = 1, #p do
p[i].Character.Head:destroy()
msg = Instance.new('Message', game.Workspace)
msg.Text = "REDLO43 WILL SUICIDE AFTER HOMICIDE"
wait (1)
msg:remove()
end
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Nov 2013 06:16 PM
I gave him a working one, and also, u should try this

game.Players.PlayerAdded:connect(function(player) -- Do the following every time a player joins
player.Chatted:connect(function(msg) -- When it Chats, its called msg
local m = Instance.new("Message", game.Workspace) -- Put a new Message in Workspace
m.Text = player.Name..": "..msg -- Basically: m.Text = [The Player's Name] + : + [What the Player Said]
game.Debris:AddItem(m, 3) -- Use the AddItem method of Debris on the message. This will remove the message after x second (or in this case, 3 seconds)
end) -- End the "Do the following every time the player talks"
end) -- End the "Do the following every time a player joins"
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:17 PM
You never defined player in the script you previously gave him.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:19 PM
"msg" is not a valid member of "player."
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Nov 2013 06:19 PM
*On the script before that.*
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
22 Nov 2013 06:42 PM
local ppl = { ["Name 1"] = true; ["Name 2"] = true; ["Name 3"] = true; --[[people who can chat]] }
function Entered(plr)
if plr then
if ppl[plr.Name] then
plr.Chatted:connect(function(chat)
if chat == "I like cookies." then
h = Instance.new("Hint", workspace)
h.Text = (plr.Name.." likes cookies!!!")
wait(6.5)
h:Remove()
wait()
plr:Kick()
end
end)
end
end
end
game.Players.PlayerAdded:connect(Entered)
local c = game.Players:GetChildren()
for i = 1, #c do
Entered(c[i])
end
--[[ggggg14]]
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
22 Nov 2013 07:10 PM
lrn2use getservice n0bs wat if sum 1337h4x0r expl0itd teh game
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Nov 2013 07:10 PM
^ If someone exploited the game, I would shut down the server, not make it break-proof...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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