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
 

Re: how to use several variables at once?

Previous Thread :: Next Thread 
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:19 PM
instead of:

function onClicked(button)
g = ...Blah = true
h = ...Blah = true
a = ...Blah = true
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2014 05:22 PM
You mean a table?

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:24 PM
i guess it's a table, yes, that i can contain several variables in it, how would i do that?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2014 05:26 PM
Something like this?

local vars = {
a = 1,
b = 2,
c = 3
}

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:27 PM
oh yess

so if the script is:


-- unqees

local a = script.Parent.Parent.Background
local b = script.Parent.Parent.enrichment
local c = script.Parent.Parent.fullcredits
local d = script.Parent.Parent.credits
local e = script.Parent.Parent.options
local f = script.Parent.Parent.spectate
local g = script.Parent.Parent.startplaying
local h = script.Parent.Parent.agameslogo
local i = script.Parent.Parent.logo

function onClicked(button)
g.TextTransparency = 0.1 wait()
g.TextTransparency = 0.2 wait()
g.TextTransparency = 0.3 wait()


it'll be:


-- unqees

local a = script.Parent.Parent.Background
local b = script.Parent.Parent.enrichment
local c = script.Parent.Parent.fullcredits
local d = script.Parent.Parent.credits
local e = script.Parent.Parent.options
local f = script.Parent.Parent.spectate
local g = script.Parent.Parent.startplaying
local h = script.Parent.Parent.agameslogo
local i = script.Parent.Parent.logo

local vars = {
d = 1,
e = 2,
f = 3,
g = 4 -- what are the numbers for, because i want it do something specific?
}

function onClicked(button)
g.TextTransparency = 0.1 wait()
g.TextTransparency = 0.2 wait()
g.TextTransparency = 0.3 wait()
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2014 05:29 PM
I don't know what you're trying to do, elaborate please?

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:31 PM
well,

as you see the variables... i want them all to fade out and "cancel their existence" (Visible = false)

with this:

g.TextTransparency = 0.1 wait()
g.TextTransparency = 0.2 wait()
g.TextTransparency = 0.3 wait()
g.TextTransparency = 0.4 wait()
g.TextTransparency = 0.5 wait()
g.TextTransparency = 0.6 wait()
g.TextTransparency = 0.7 wait()
g.TextTransparency = 0.8 wait()
g.TextTransparency = 0.9 wait()
g.TextTransparency = 1 wait()
wait()
g.Visible = false



instead of messing up with each of the several variables, i need to make the variables d, e, f and g to fade out at the same time and making the script short.
Report Abuse
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:32 PM
idk how tables work and ROBLOX wiki doesn't help.
Report Abuse
Exllumina is not online. Exllumina
Joined: 28 Jun 2014
Total Posts: 6314
24 Aug 2014 05:34 PM
i realize i need a table first... not sure how to do it
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