R3pix
|
  |
| Joined: 07 Jan 2012 |
| Total Posts: 2642 |
|
|
| 20 Dec 2015 11:44 PM |
I need help. Basically, I want to detect if any player chats. I haven't been able to do this without an error!
Thanks, R3pix.
Yesterday, tomorrow, new zealand? |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2015 11:46 PM |
game.Players.PlayerAdded:connect(function(plr) --hook up every time a player joins plr.Chatted:connect(function(msg) --get msg everytime ^^this guy (plr) chats print(plr.Name .. ' said: ' .. msg) --print msg end) end) |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 20 Dec 2015 11:46 PM |
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) -- stuff end) end) |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2015 11:49 PM |
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) print(msg) end end |
|
|
| Report Abuse |
|
|
R3pix
|
  |
| Joined: 07 Jan 2012 |
| Total Posts: 2642 |
|
|
| 20 Dec 2015 11:53 PM |
No heres the thing, I want it to be a script builder script, or also a script that will run once everybody is ALREADY IN the game. I didn't specify in my Original Post, sorry.
Yesterday, tomorrow, new zealand? |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 21 Dec 2015 12:04 AM |
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if(msg[1]==':')then loadstring(msg.substr(2,#msg))() end end) end)
-- execute strings starting with ':' -- ex -- :print("HI") |
|
|
| Report Abuse |
|
|
| |
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 21 Dec 2015 12:10 AM |
| yeup. there's some sandboxing stuff you can do before executing the string, but thats a bit out of the scope of this question |
|
|
| Report Abuse |
|
|
R3pix
|
  |
| Joined: 07 Jan 2012 |
| Total Posts: 2642 |
|
|
| 21 Dec 2015 12:21 AM |
Nonono, I meant a script FOR script builder xd
Yesterday, tomorrow, new zealand? |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 21 Dec 2015 12:22 AM |
i don't see the issue, you can do any script in script builder, why not use ones posted before?
you're not making much sense |
|
|
| Report Abuse |
|
|
Querq
|
  |
| Joined: 10 Apr 2013 |
| Total Posts: 486 |
|
|
| 21 Dec 2015 12:23 AM |
for i,v in pairs(game.Players:GetPlayers()) do v.Chatted:connect(function(msg) if msg == "hi" then workspace.Base:Destroy() end end) |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2015 01:40 AM |
| @que, that destroys the baseplate when chat |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
| |
|