This script is suppose to add 1 to a NumberValue when clicked IF the value is less than 11, but there are no errors or anything for that matter in the output and it doesn't work. Whats wrong?
-- Made by AwsomeSpongebob HairVal = game.Workspace.Dummy.Hair.Value.Value Button = script.Parent Button.MouseButton1Click:connect(function() if HairVal < 11 then HairVal = HairVal + 1 end end)
P.S. Dummy and Hair are both models, there is a numbervalue located inside the Hair model.
Where you have put
HairVal = game.Workspace.Dummy.Hair.Value.Value
You are setting HairVal to the value itself, so maybe 4 or 8, not the actual object. In this case you want to do this:
HairVal = game.Workspace.Dummy.Hair.Value 04 Button = script.Parent 05 06 Button.MouseButton1Click:connect(function() 07 if HairVal.Value < 11 then 08 HairVal.Value = HairVal.Value + 1 09 end 10 end)
This way you are not accessing a literal value, like 7 or 4, but the actual objects value.
-- If I helped leave a +1 Rep <3