Please help. What's wrong with this script? It's suppose to make a gui appear when the Intvalue is at a certain value but It does not work. Please help me fix it!
local Frame = script.parent Local Value = script.parent.IntValue.Value If Value = 3 then Frame.visible = true Elseif Value = 2 or 1 or 0 then Frame.visible = false
My gui wont appear based off the value?
2 answers
You're simply using the wrong symbol. One equal sign = is meant to assign a variable to a value.
When comparing Instances, there are two comparison symbols you can use:
- Equal to
a == b. If a is the same as b, then do something. - Not equal to
a ~= b. If a and b are not the same, do something.
In your case, because you are seeing if something is the same as another thing, you should be using == instead of =.
3 comments
This answer should be easier to understand.
i'll just accept ur answer since mezorno makes no sense
lol really
You're using the assignment variable when you should be comparing the values.
if i = 3 then
The above line of code reads as "if i equals 3 then complete this code"
What you really want it to say is "If i is equal to 3 then complete this code"
The code form of that would be the comparative sign ==, this compares the values on either side and returns either true or false based on the outcome.
2 comments
Im confused
"The" comparative sign? There's more than one, you know.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
remove the elseif and replace it with else Frame.Visible = false
what does it print?
u need elseif lowercase E and after that Value == 2 or 1 or 0 then