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: Quick Module Script question

Previous Thread :: Next Thread 
CoreMain is not online. CoreMain
Joined: 18 Jul 2014
Total Posts: 78
15 Jan 2015 07:17 PM
If let say I have a module and a script

[Module]

function f(b)
local a = 0
a = b + a
return a
end

return f

[Script]
local f = require(workspace.f)

local f1 = f(13)
local f2 = f(666)




Both f1 and f2 will be consider different "classes" as in they won't be the same variable, right?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
15 Jan 2015 07:22 PM
Of course they won't be the same variable.

But since it isn't a table or function, you can just do it like this.

local f1 = 31
local f2 = f1
f1 = -2

And f1 and f2 are different variables.

It doesn't work that way with tables or functions though.

But since it is a local variable in your f function, of course it is no problem. But it wouldn't be a problem anyways.
Report Abuse
CoreMain is not online. CoreMain
Joined: 18 Jul 2014
Total Posts: 78
15 Jan 2015 07:23 PM
Okay, thanks. I was just making sure... didn't want buggy modules.
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