1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:23 PM |
Can someone tell me how to use them and what they mean? Like for example:
function Chat(Message,Player) -- What does the comma do there and what is Player? end game.Players["1Topcop"].Chatted:connect(Chat) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 11 Nov 2011 07:28 PM |
| The comma separates 2 different values. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:29 PM |
| Well what are the meanings in each value is what I want to know. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 11 Nov 2011 07:30 PM |
| Aren't they self explanatory by the name? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:32 PM |
Well, I mean, don't they have the same value with diffrent tags? like you can put
function(JIF,BOB) instead of function(Message,Player) and it would be the same values, right? |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2011 07:33 PM |
Anyway, those are the parameters/arguments of the function. They're variables used by the function.
function AddTheseNumbers(FirstNumber,SecondNumber) return FirstNumber + SecondNumber end
print(AddTheseNumbers(1,5))
>6
-[::ƧѡÎḾḠΰῩ::]- -[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 11 Nov 2011 07:34 PM |
| I pretty sure that it would be the same. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:35 PM |
Well how do I find like witch is witch? Sorry I'm a narb :P
But I don't know how to use this :c |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2011 07:37 PM |
You can name your arguments anything you want.
function I_LEIK_CAKE(YAY, LOLZ) return YAY + LOLZ end
print(I_LEIK_CAKE(1,5))
>6
The script assigns 1 to the variable YAY and 5 to the variable LOLZ.
-[::ƧѡÎḾḠΰῩ::]- -[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:39 PM |
Interesting, I think I'm starting to get it, so if I put...
function Chat(Message,Player) Chat(Message,game.Players["1Topcop"]) end game.Players["1Topcop"].Chatted:connect(Chat)
Player would become me? |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2011 07:40 PM |
Well your first problem would be that your script will crash your game.
-[::ƧѡÎḾḠΰῩ::]- -[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2011 07:41 PM |
| That would result in a stack overflow, which lags the game severely for a few seconds then breaks the script. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:42 PM |
*Twitch* Ermmm... yeah.. I'm not gettin this o.o More help pl0x? D: |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2011 07:43 PM |
| You are calling the function within the function; it'll get stacked up against itself with no wait time. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 11 Nov 2011 07:44 PM |
._.
Can you tell me then, how do I make a chat that finds who said it? |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 06:04 PM |
playerwhospoke = nil game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function() playerwhospoke = p end) end) |
|
|
| Report Abuse |
|
|