Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
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'.

1 comment

0

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.