|
| 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
|
  |
| 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
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Nov 2013 05:25 PM |
Coool! Are you the maker of the cookie game?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
|
| 22 Nov 2013 05:35 PM |
| Kev the problem's your argument |
|
|
| Report Abuse |
|
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 22 Nov 2013 05:49 PM |
| I also fixed all your errors. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2013 05:55 PM |
Capitalize the p in players.
Game.Players |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 22 Nov 2013 06:19 PM |
| "msg" is not a valid member of "player." |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 22 Nov 2013 06:19 PM |
| *On the script before that.* |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 22 Nov 2013 07:10 PM |
| lrn2use getservice n0bs wat if sum 1337h4x0r expl0itd teh game |
|
|
| Report Abuse |
|
|
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 |
|
|