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: GUYS I think varibles kind of broke....

Previous Thread :: Next Thread 
Mzh3000 is not online. Mzh3000
Joined: 22 Jan 2009
Total Posts: 4967
27 Nov 2011 09:56 PM
When I tried a script and it had no output but also did nothing.

So I this much simpler script to do the same thing, but got nothing.

THis script wouldnt work right?

e = script.Parent.Reflectance

while true do
e = 0.1
wait(0.1)
e = 0.2
wait(0.1)
e = 0.3
wait(0.1)
e = 0.4
wait(0.1)
e = 0.5
wait(0.1)
end


But this would.



while true do
script.Parent.Reflectance = 1
wait(0.1)
script.Parent.Reflectance = 0.2
wait(0.1)
script.Parent.Reflectance = 1
wait(0.1)
script.Parent.Reflectance = 0.4
wait(0.1)
script.Parent.Reflectance = 0.5
wait(0.1)
end



either I have gone retarded and messed up on variables or somethings definately broken on Roblox.

The top one wont work but the bottom one will... D:
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
27 Nov 2011 09:58 PM
I value can not be a variable. That is why the bottom one works.

~Some things were never meant to change~
Report Abuse
Mzh3000 is not online. Mzh3000
Joined: 22 Jan 2009
Total Posts: 4967
27 Nov 2011 09:59 PM
oh it can't be a variable?

That's definately new to me..
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
27 Nov 2011 10:01 PM
Once you declare a variable, it won't BE that property, e will become whatever reflectance was at that time. Then all you're changing is the variable. You want to do it like this :

    e=script.Parent
    
    while true do
        e = 0.1
        wait(0.1)
        e = 0.2
        wait(0.1)
        e = 0.3
        wait(0.1)
        e = 0.4
        wait(0.1)
        e = 0.5
        wait(0.1)
    end

Also look up for loops on the wiki.
Report Abuse
Mzh3000 is not online. Mzh3000
Joined: 22 Jan 2009
Total Posts: 4967
27 Nov 2011 10:02 PM
I see.... But I want the reflectance without copypasting that ugly line.
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
27 Nov 2011 10:04 PM
whoops, that's what I get for editing it instead of rewriting

    e=script.Parent
    
    while true do
        e.Reflectance = 0.1
        wait(0.1)
        e.Reflectance = 0.2
        wait(0.1)
        e.Reflectance = 0.3
        wait(0.1)
        e.Reflectance = 0.4
        wait(0.1)
        e.Reflectance = 0.5
        wait(0.1)
    end

and really, look up for loops. You could do this in 4 lines instead of 20.
Report Abuse
Mzh3000 is not online. Mzh3000
Joined: 22 Jan 2009
Total Posts: 4967
27 Nov 2011 10:04 PM
Got it.

e=script.Parent

while true do
e.Reflectance = 0.1
wait(0.1)
e.Reflectance = 0.2
wait(0.1)
e.Reflectance = 0.3
wait(0.1)
e.Reflectance = 0.4
wait(0.1)
e.Reflectance = 0.5
wait(0.1)
end



yup ty for the help.
Report Abuse
Mzh3000 is not online. Mzh3000
Joined: 22 Jan 2009
Total Posts: 4967
27 Nov 2011 10:05 PM
o lol we posted at the same time. This was the script I was trying in the first place.



e = script.Parent.Reflectance

for i = 1,5 do
wait()
e = e+1
end

for i = 5,1 do
wait()
e = e-1
end
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