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: .Chatted not working?

Previous Thread :: Next Thread 
samthemagicman is not online. samthemagicman
Joined: 20 Mar 2011
Total Posts: 1225
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
SimplyPure is not online. SimplyPure
Joined: 23 Jan 2011
Total Posts: 102
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 is not online. 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 is not online. 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
samthemagicman is not online. samthemagicman
Joined: 20 Mar 2011
Total Posts: 1225
24 Nov 2013 01:00 PM
Ah I got confused.

Thank you, Absurdism.
Report Abuse
Absurdism is not online. 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 is not online. 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 is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
24 Nov 2013 01:03 PM
Ah, okay.
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