|
| 24 Nov 2013 12:47 PM |
Hello.
Why isn't this simple Chatted script not working? ;c
function chat(msg, player) player.Character:BreakJoints() end script.Parent.Parent.Chatted:connect(chat)
Is the Chatted function broken or something? Please help..
Thanks. |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 12:57 PM |
| Well I never used the .Chatted function but I have used functions... you call the script when they chat I see... But at the end :connect(chat) isn't there supposed to be two variables in (chat) like (chat(var, var2)) because you put the msg and player as a parameter(I think its called). |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 24 Nov 2013 12:58 PM |
The variable you define as 'player' actually returns an instance known as the recipient. The recipient variable was a failed attempt to try and get to whom the message was sent. I do not recommend using it, nor do I think you intended to use it.
script.Parent.Parent.Chatted:connect(local function(msg) script.Parent.Parent.Character:BreakJoints() end) |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 24 Nov 2013 12:59 PM |
That cant be it. I'm wondering what script.Parent.Parent is, whether this is a LocalScript or a regular script, and how this script became a Descendant of Player |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 01:00 PM |
Ah I got confused.
Thank you, Absurdism. |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 24 Nov 2013 01:01 PM |
| I know, I also wondered that. This was the immediate problem though; recipient never works and it isn't the intention of the player variable. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 24 Nov 2013 01:01 PM |
| I meant that cant be it to the post above yours Absurdism XD |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
| |
|