When i try to increase IntValue, nothing happens, this is mostly the script i use
value = script.Parent.Value
value = value + 1
but it isn't working when i try doing it for menu
When i try to increase IntValue, nothing happens, this is mostly the script i use
value = script.Parent.Value
value = value + 1
but it isn't working when i try doing it for menu
If we look at the code from the script's perspective we'll be able to find out what's actually going on.
-- The variable will get a number value
-- because of "script.Parent.Value"
-- let's imagine the returned number value is 3
value = script.Parent.Value
value = value + 1
-- The code above will pretty much translate to the following:
3 = 3 + 1
Let's now move on the solution
-- Instead of getting the number value, we instead
-- get the object itself.
object = script.Parent
-- and then set the property "Value" to the previous value
-- with a increment of 1
object.Value = object.Value + 1
i will try this
no doesn't work still
The change is not read by the client? If it still isn't, it probably means that the script cannot find the IntValue. Use WaitForChild().
value = script.Parent.Value.Value
value = value + 1
You forgot to get into the value property
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Ok give us more info, what is "value", where did you put "value" where did you put the LocalScript?, any error in the output window? what do you mean trying to do it for menu?