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 » Scripters
Home Search
 

Re: Chatted > Recipient is nil

Previous Thread :: Next Thread 
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
29 Jul 2015 06:33 PM
function commands(chatContent,plr)
if chatContent == "die" then
plr.Character.Humanoid.Health = 0
end
end


index local 'plr' (a nil value)
plr is supposed to be the player from game.Players who chatted right?
Just wanna get this over with then I will sleep. Thank you!
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
30 Jul 2015 03:15 AM
Just woke up. Bump
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
30 Jul 2015 03:28 AM
No.

You didn't pass a second argument to that function, or the argument you passed to it is nil.
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
30 Jul 2015 05:19 AM
Second argument? What is that.

I don't even know what an argument is in scripting q-q
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
30 Jul 2015 05:55 AM
It only passed chatContent
Report Abuse
ShungTzu is not online. ShungTzu
Joined: 14 Jun 2014
Total Posts: 959
30 Jul 2015 05:04 PM
When you call this function

function commands(chatContent,plr)

, you have to tell it what "chatContent" and what "plr" mean. Your call will be something like this:

commands(aVariableTheValueOfWhichIsTheChatContent,aPlayerWhichHasBeenIdentifiedAsThisVariable)

or direct references to those things, eg;

game.Players.SomePlayer.Chatted:connect(function(themessage)
commands(themessage,game.Players.SomePlayer)
end)

, or to the player at least.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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