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: variable change

Previous Thread :: Next Thread 
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Mar 2014 06:10 PM
Can you easily detect if a variable is changed?
Like detecting if the following is changed.


local qnumber = 1
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
29 Mar 2014 06:11 PM
Short answer: no
Report Abuse
JigglingJack is not online. JigglingJack
Joined: 25 Mar 2014
Total Posts: 11263
29 Mar 2014 06:12 PM
if not qnumber==1 then
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Mar 2014 06:12 PM
Good.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
29 Mar 2014 06:14 PM
But it's possible. Might I ask why?
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Mar 2014 06:42 PM
eh, just wanted to see if I could do something with a health gui. If you loose health, screen flashes red, gain, it flashes green. I was thinking of something like


function onupdate(oldvalue)
while wait() do
return newvalue
end
end

onupdate(12)


of course, it would be much more advanced than that. I was just wondering if there was an easier way.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
29 Mar 2014 06:43 PM
You could use the Changed method if it's an object. But not for variables.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
29 Mar 2014 06:48 PM
You can use metatables if you're willing to go that far.

http://www.lua.org/pil/13.4.4.html
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Mar 2014 06:57 PM
I believe that roblox does support metatables. Am I wrong. I dont really care, it was just a concept in my head.
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Mar 2014 06:58 PM
*I don't believe*




game.Workspace.Missile.MainPart.BodyPosition.position = game.Forum.FloodCheckV2.9.Location.p
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