Hi guys; I have a script that I want to be fired when a numbervalue changes from 0 to 1 however I cannot find any good tuts on how to use the Changed event. The value is kept in an another group called values from the script.
Script > Values > Value 1 (This has the number value)
Thanks for your time guys. Goldenggamper
Edit --- I'm hoping that one of you guys might be able to lead me into the right direction on how to use the Changed event. How do you tell it what value it should be looking at for it to trigger the event, etc.
To use the change event, you should use it on a part/value, I will use an IntValue as an example:
game.Workspace.IntValue.Changed:connect(function() -- do stuff end)
The above function will run every time a property of the object has been modified. Hope I helped.
Ah, so you want to learn about the Changed event.
What it does is fire every time any of an object's properties changes, and supplies an Property
argument, which is a string name of the property that changed (such as "BrickColor" or "Transparency").
To make it watch a specific property, just add an if statement for the property.
SomeObject.Changed:connect(function(Property) if Property == "Transparency" then print("Transparency changed!") end end)
That would pring Transparency changed!
every time SomeObject
's Transparency property changed.
Thanks to 18cwatford and Owenrules12 for their previous help :)