11101101
|
  |
| Joined: 01 Jun 2011 |
| Total Posts: 72 |
|
|
| 10 Nov 2011 09:31 PM |
Can you find the "origin", or name of an original given variable?
For example (so that you can understand):
-----------------------------------------------------------------------
function test(vectornum) vec = string.upper(string.origin???(vectornum)) --HERES WHERE I HAVE NO CLUE if vec == "X" then brick.Position = Vector3.new(vectornum, brick.Position.Y, brick.Position.Z) end
if vec == "Y" then brick.Position = Vector3.new(brick.Position.X, vectornum, brick.Position.Z) end
if vec == "Z" then brick.Position = Vector3.new(brick.Position.X, brick.Position.Y, vectornum) end
end
local x = math.random(50,60) local y = math.random(50,60) local z = math.random(50,60) test(x) test(y) test(z)
-------------------------------------------------------------------------
I know it would be easier to just include the demension in the function call, but I'm just wondering out of curiousity if this is possible, or does Lua during a call simply just give functions the variable value and leaves no clues as to what the name of the original variable was? |
|
|
| Report Abuse |
|
11101101
|
  |
| Joined: 01 Jun 2011 |
| Total Posts: 72 |
|
|
| 10 Nov 2011 09:32 PM |
| The example i provided was a raw script that i just created in like 2 minutes, i bet there is errors... |
|
|
| Report Abuse |
|
11101101
|
  |
| Joined: 01 Jun 2011 |
| Total Posts: 72 |
|
| |