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
|
  |
| Joined: 15 Mar 2012 |
| Total Posts: 1571 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 30 Jul 2015 05:55 AM |
| It only passed chatContent |
|
|
| Report Abuse |
|
|
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 |
|
|