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 » Scripters
Home Search
 

Re: How do I increase the value every time the script runs

Previous Thread :: Next Thread 
zodiacsage is online. zodiacsage
Joined: 25 Sep 2014
Total Posts: 69
18 Apr 2017 12:09 PM
function grow()
while true do
val = script.Value.Value
c = script.Parent.CFrame
script.Parent.Size = script.Parent.Size + val
script.Parent.CFrame = c
wait(1/30)

end
end
grow()

Basically I want it to grow faster and faster gradually
Report Abuse
kellymoose is not online. kellymoose
Joined: 13 Sep 2016
Total Posts: 1027
18 Apr 2017 12:11 PM
what do you mean by "run?"
do you mean every frame or every time the script is enabled?


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
18 Apr 2017 12:15 PM
local function grow()
while true do
local val = script.Value.Value
local c = script.Parent.CFrame
script.Parent.Size = script.Parent.Size + Vector3.new(val.Value, val.Value, val.Value)
script.Parent.CFrame = c
wait(1/30)

end
end
grow()

val.Value = val.Value + 1
Report Abuse
WrathOfTheElvhen is online. WrathOfTheElvhen
Joined: 12 Jul 2012
Total Posts: 7754
18 Apr 2017 12:42 PM
Assuming the value inside of the script is a NumberValue and not a Vector3 value, then you'd want to change this line...

script.Parent.Size = script.Parent.Size + val

to

script.Parent.Size = script.Parent.Size * val

Otherwise, if script.Value is a Vector3 value, it should work fine (although it won't accelerate its growth as time goes on).
Report Abuse
zodiacsage is online. zodiacsage
Joined: 25 Sep 2014
Total Posts: 69
18 Apr 2017 02:05 PM
This thread helped me a lot thank you for the people who posted
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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