TwoOfFive
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 2532 |
|
|
| 15 Jan 2015 04:03 PM |
When I do something like this
function name() Thing = true Variable1 = "Hello" if Thing == true then Variable1 = "Goodbye" end
I just made a global variable, but it's not working inside that If statement
If I run that there are two Variable1s. One that says Hello and one that says Goodbye.
Is this a bug? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 15 Jan 2015 04:14 PM |
| your just overwriting one variable with another value |
|
|
| Report Abuse |
|
|
TwoOfFive
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 2532 |
|
|
| 15 Jan 2015 04:27 PM |
No It doesn't overwrite
That's the problem here. All it does it make two variables with the same name. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
|
| 15 Jan 2015 04:30 PM |
Maybe it has to do with the scope.
How do you know it does this?
Proof? |
|
|
| Report Abuse |
|
|