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: I need help where . . .

Previous Thread :: Next Thread 
Iffix is not online. Iffix
Joined: 27 Sep 2013
Total Posts: 484
18 Mar 2014 09:10 PM
I can find all the variables at once and change them.

Can I do that? If so, how?

thanks.
Report Abuse
lowvillan is not online. lowvillan
Joined: 14 Sep 2010
Total Posts: 725
18 Mar 2014 09:11 PM
As previously stated, no.
srry
Report Abuse
Iffix is not online. Iffix
Joined: 27 Sep 2013
Total Posts: 484
18 Mar 2014 09:11 PM
oh you're here too. posted in two forums for 2x help.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 09:15 PM
Use a for loop,dur

for I,v in pairs(Workspace:GetChildren()) do--change workspace to Workspace.ModelName if there in a model..
ypcall(v.Value = v.Value+1)
end
Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
18 Mar 2014 09:20 PM
what does ypcall do?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 09:22 PM
Will continue the script,regardless of errors
Workspace
-Part
-NumberValue

for I,v in pairs(Workspace:GetChildren()) do
ypcall(print (v.Value))
end

Part has no "Value" so without ypcall,it'd stop it cold..
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 09:59 PM
variables or objects?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:01 PM
/\
If they are variables,won't they need to be in a table?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:02 PM
Not if they are global variables (non-local)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:08 PM
Well actually, I'm half-wrong. All global-variables are stored in the environment, which is a table.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:08 PM
Ok..but u can't exactly say

for I,v in pairs (_G) do
Can you?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:09 PM
Not talking about the Global table, but you can do that
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
18 Mar 2014 10:09 PM
@island
Actually, you can =P
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:10 PM
Really?
Like..
_G.a = 1
_G.b = 2
for I,v in pairs(_G) do
print (v)
end
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
18 Mar 2014 10:11 PM
_G.a = 1
_G.b = 2
for i,v in pairs(_G) do
print(i,v)
end

>a 1
b 2

=P
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:12 PM
Yeah, but I wasn't talking about things in the global table, I was talking about global variables (like: a = 5 or part = workspace.Part)
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
18 Mar 2014 10:12 PM
Declaring a global variable is much like doing this:

_B = {}
rawset(_B, "a", 1)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:14 PM
Wow..
After some thought(I only recently started using tables ok?:3)
_G is a table..
So,yeah..that's just..
Awesome
:P
So this would work?

_G.Hello = "Hi"
_G.GoodBye = "By"

for I,v in pairs(_G) do
print (I.."'s Meaning is",v)
end
-Hello's value is Hi
-GoodBye's value is By
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:14 PM
you mean a key-value pair in the global table?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:16 PM
Oop,meant to change "Meaning" to value
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:16 PM
yeah it'd work
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:19 PM
Anways
This got really sidetracked
OP asked:
Is there any way to FIND ALL THE VARIABLES AND CHANGE THE VALUES?
Unless u use a table or the _G table,I doubt it..
Unless you define ea,h one
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 10:21 PM
You can if they are global variables (not making the variable local)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 Mar 2014 10:22 PM
Like

_G.a = 1
_G.b = 2

for I,v in pairs(_G) do
--I.v = 1 probly rong
--I = 1
--v = 1
end
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
18 Mar 2014 10:23 PM
@cnt
No. This is practically the same thing:
_G.bob = "hi"

_B = {}
rawset(_B, "bob", "hi")

print(_G.bob)
print(_B.bob)

See what I'm trying to get at?
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