of     1   

MagicGivePen
#194124810Wednesday, July 20, 2016 4:53 PM GMT

The functions must use the same variable values even if they are changed during the function's job. Example function a() -- because the problem is in the functions print(b) -- (had to make this a comment due to the under 13 censorship) [put in this line "wait" then "1" in "()"] print(b) end b = 1 spawn(a) -- making this happen in a thread because it is a part of the problem wait(0.5) b = 2+3 Results How is it 1 5 How should it be 1 1 I think it should happen because now there are some complications caused by this. After this happening the problems would be solved and some new but easier problems would happen. Because of the current problem this simple concept became unnecesarily complicated to make. https://forum.roblox.com/Forum/ShowPost.aspx?PostID=194051652
NiceSuperLuigi108
#194125073Wednesday, July 20, 2016 4:57 PM GMT

MagicGivePen
#194125261Wednesday, July 20, 2016 4:59 PM GMT

"Wrong Subforum" What is this subforum for then? It does not have to be a suggestion for the normal Lua, it can also be for the ROBLOX Lua.
ThrowYou
#194126276Wednesday, July 20, 2016 5:14 PM GMT

You go to the subforum "Scripters" for this stuff
BothAngles
#194126695Wednesday, July 20, 2016 5:20 PM GMT

MagicGivePen
#194127705Wednesday, July 20, 2016 5:33 PM GMT

"You go to the Scripter subforum for this stuff"(you probably know why changed) No. This is a suggestion for ROBLOX. "https://forum.roblox.com/Forum/ShowPost.aspx?PostID=193916819 Read the third post" This will work with common routines(this probably too) too.
MagicGivePen
#194133474Wednesday, July 20, 2016 6:52 PM GMT

For the developers.
MagicGivePen
#194208712Thursday, July 21, 2016 5:58 PM GMT

I hope there will not be any more people who wrongly think this thread belongs to the scripter subforum.
MagicGivePen
#194277345Friday, July 22, 2016 2:53 PM GMT

Time for more feedback!
BothAngles
#194280464Friday, July 22, 2016 3:40 PM GMT

How should it be 1 1 if you're changing b to 5....
IronForumer
#194280608Friday, July 22, 2016 3:43 PM GMT

Lua already has functions. IronForumer | ⚡ TEAM INSTINCT ⚡
MagicGivePen
#194281051Friday, July 22, 2016 3:49 PM GMT

" How should it be 1 1 if you're changing b to 5.... " Keep the old value.
MagicGivePen
#194296087Friday, July 22, 2016 7:24 PM GMT

Am I the only one who wants easier developing?
warspyking
#194296610Friday, July 22, 2016 7:31 PM GMT

The code works fine and you just need to learn basic programming principles. ROBLOX isn't going to modify Lua's logic because of your nonsensical needs. No support.
httpweb
#194297157Friday, July 22, 2016 7:38 PM GMT

Support.
MagicGivePen
#194297262Friday, July 22, 2016 7:40 PM GMT

"nonsensical needs" Did you read my reasoning or forgot it? I showed the sense.
warspyking
#194298276Friday, July 22, 2016 7:54 PM GMT

I read it, it's just your reasoning is stupid. Expecting to index a variable (which I might remind you is part of a table called an environment) and getting an old value isn't right. If the environment changes, you'll get a different value. If you want to keep an old environment, look into setfenv/getfenv.
jackjgiffin
#194299147Friday, July 22, 2016 8:05 PM GMT

The reason that your code is not working is because of the thread scheduler. After you spawn function a, function a prints the value of b, then 0.5 seconds are waited before changing the value of b to 5, but the spawned function a waits 1 second (which is more than .5 seconds) to print the value of b again, so by the time the function a prints the value of b, the value of b has already changed to 5. I believe what you are trying to accomplish is using scope: http://wiki.roblox.com/index.php?title=Scope B.T.W: Why would you think that wait(1) is inappropriate for kids under 13 years old???
jackjgiffin
#194299461Friday, July 22, 2016 8:09 PM GMT

Sorry, link to roblox wiki didn't work because roblox annoyingly changes http liks to https. Here is the working like: wiki.roblox.com/index.php?title=Scope
MagicGivePen
#194432900Sunday, July 24, 2016 1:57 PM GMT

"I believe what you are trying to accomplish is using scope" Now I am thinking about making a thread about the most forgotten stuff in Lua. @my idea No support, use local variables. "B.T.W: Why would you think (this) is inappropriate for kids under 13 years old???" Me? Me?! The censorship for under 13 players thinks so!
jackjgiffin
#194547213Monday, July 25, 2016 10:22 PM GMT

I am very doubtful that roblox has rules about censoring wait(1), so please post a link to your source for this information.
MagicGivePen
#194589695Tuesday, July 26, 2016 10:51 AM GMT

"I am very doubtful that roblox has rules about censoring wait(1), so please post a link to your source for this information." Under 13 players still have got a whitelist(except liars who have blacklist) even though it is harder to notice now! Somehow it does not work. And do not except everyone over 12 to have their ages set to over 12! According to the new Terms of Service you must not ever lie about your age, so trying to verify my information by yourself is not going to be simple. And you have to prepare your parent(or yourself if you are over 17) to leave a voicemail to get back to your age. IT WAS NOT ME, IT WAS THE WHITELIST ON THE TWENTIETH OF JULY. IF YOU WANT PROOF IT WAS LIKE THIS(WHICH YOU SHOULD NOT EXCEPT AT ALL) THEN LOOK AT THESE: https://web.roblox.com/1-item?id=465008000 https://web.roblox.com/2-item?id=465008123. IF YOU STILL DO NOT BELIVE ME THEN LEAVE THIS THREAD UNLESS YOU HAVE GOT SOMETHING ELSE TO ADD.
MagicGivePen
#194589710Tuesday, July 26, 2016 10:52 AM GMT

MagicGivePen
#194604897Tuesday, July 26, 2016 4:54 PM GMT


    of     1