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: Parameters

Previous Thread :: Next Thread 
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
24 Feb 2016 08:00 PM
Isnt it a variable for something in a function that will be called at the end of the script?
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
24 Feb 2016 08:01 PM
I know there are default parameters relevant to something in the event but ive seen people put random variables.
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
24 Feb 2016 08:03 PM
A variable is something that you can store other things inside, such as a table, or a string.

Example:

x = (1 + 2) -- This sets "x" as a variable that stores the string "(1+2)"

print(x) -- This prints the variable. The outcome would be:

3


~MightyDantheman
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
24 Feb 2016 08:08 PM
parameters are the variables given to the function to call it

arguments are the variables in the function call

function foo(a,b) -- a and b are parameters
print(a,b)
end

foo("bar","rab") -- "bar" and "rab" are arguments

Report Abuse
Moronism is not online. Moronism
Joined: 08 Feb 2010
Total Posts: 451
24 Feb 2016 08:12 PM
Parameters are localized versions of arguments "passed" to a given function.

Example:

Money = 100;

function New_Money(M)

M = M - 1;

return M;

end

print(New_Money(Money)); --This would print 99

Note that within the function known as "New_Money", "M" is the single parameter available.

Since "M" is a local variable, the modifications to M will not extend to the variable "Money." It is limited solely to the scope of the function it was created within.

Thus, "Money" will still be equivalent to 100.
Report Abuse
MetallicFrog is not online. MetallicFrog
Joined: 22 Feb 2016
Total Posts: 124
24 Feb 2016 09:22 PM
You tardbag, M is not a local variable.

-MetallicFrog | 15,000 posts | Scripter | Builder |
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Feb 2016 09:32 PM
Yes, it is.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Feb 2016 09:33 PM
But his explanation is wrong.

'Since "M" is a local variable, the modifications to M will not extend to the
variable "Money." It is limited solely to the scope of the function it was created within.'
That's not why it does that bud
Report Abuse
MightyDantheman is online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
24 Feb 2016 09:34 PM
Sorry, I forgot about the title. :T


~MightyDantheman
Report Abuse
MetallicFrog is not online. MetallicFrog
Joined: 22 Feb 2016
Total Posts: 124
24 Feb 2016 09:46 PM
No, what I'm saying is that it's not local in the sense that I could print(M) outside of the function.

-MetallicFrog | 15,000 posts | Scripter | Builder |
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Feb 2016 09:49 PM
No you can't
Report Abuse
MetallicFrog is not online. MetallicFrog
Joined: 22 Feb 2016
Total Posts: 124
24 Feb 2016 09:50 PM
Really? I always thought it needed a prefix of local. Must be my mistake, thanks for letting me know! My knowledge grows again! *And the crowd starts clapping in happiness for me*

-MetallicFrog | 15,000 posts | Scripter | Builder |
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Feb 2016 09:52 PM
Parameters are local variables, M can only be accessed from inside that function.
Report Abuse
MetallicFrog is not online. MetallicFrog
Joined: 22 Feb 2016
Total Posts: 124
24 Feb 2016 09:53 PM
Well, that would explain why. Thanks for letting me know- but do you care to take a look at my rating thread? I need some opinions from experienced people, I've only been coding and building for a short period.

-MetallicFrog | 15,000 posts | Scripter | Builder |
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
24 Feb 2016 09:54 PM
That makes sense so after the ends i would have to re define it.
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