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 » Scripting Helpers
Home Search
 

Finding the Origin of Variables?

Previous Thread :: Next Thread 
11101101 is not online. 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 is not online. 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 is not online. 11101101
Joined: 01 Jun 2011
Total Posts: 72
10 Nov 2011 09:45 PM
Anybudy?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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