|
| 01 Jan 2013 11:32 AM |
How can i do an onchatted() script?
As in
I say "Open sesame" and the door gets removed.
-Crazy old man. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 01 Jan 2013 11:36 AM |
game.Players.BlizardAlpha.Chatted:connect(function(msg) if msg:lower() == "open sesam" then door:Destroy() end end) |
|
|
| Report Abuse |
|
|
LGR100
|
  |
| Joined: 02 Jan 2011 |
| Total Posts: 922 |
|
|
| 01 Jan 2013 11:37 AM |
Game.Workspace.Player ()OnChatted Game.Workspace.Model --(Change variable goes here :P) IDK If this is right, but close. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 01 Jan 2013 11:39 AM |
| @LGR, we appreciate help, but if u actually dont know how to script this dont post, not tryin to be rude, its the truth in SH. |
|
|
| Report Abuse |
|
|
12packkid
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1418 |
|
|
| 01 Jan 2013 12:57 PM |
Fedorakid did use the shortest method available, but if you want a more reliable onChatted then do this.
adminlist = {"Names"}
for _,v in pairs(game.Players:GetChildren()) do for a,c in pairs(adminlist) do if v.Name == c then
function chat(msg) if msg == "open sesame" then door:Destroy() end end adminlist.Chatted:connect(chat) end end end |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 01 Jan 2013 01:13 PM |
| That's using a list of "admins". I think he just wanted a Chatted() event function. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 01 Jan 2013 01:27 PM |
| If he wanted an admin, he would have asked for that now wouldnt he. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2013 04:06 PM |
| Thanks! Both methods were helpful! |
|
|
| Report Abuse |
|
|