So Im working on making a few things change when the number on a gauge reaches a certain number. [See this place for reference : http://www.roblox.com/WhoDunIt-place?id=112054663 ] How would I go about doing this? I can give more elaboration if needed.
COMMUNITY QUESTION
How to make something change when a value reaches a certain number?
1 answer
What you are going to do need is this..
First you are going to route to it.. If it's an IntValue named 'Cookie' inside workspace it would be like.. (And this is a script located as a child of IntValue 'Cookie'
C = script.Parent
script.Parent.Changed:connect(function ()
if C.Value == 1 then -- Change 1 to the number needed or wanted.
-- Code
else
print("Not correct")
end
end)
This is all you need really. what this does is when the IntValue 'Cookie' is updated, it checks to see if the value is == 1, if so it will do what the code is, if it isn't.. It will print 'Not correct'.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks. Im having a hard time modifying it though, the script is going to be in a completely different model, and it isnt a value thats being changed, its the name of a child of the model I need to alter.