so I’m trying to get a string attribute and compare it in my script so basically I get the attribute and compare it to my strings that I put into the script but the thing is it always returns a true value no matter if the string i put in the script is the same as the attribute or not, is what I’m trying to do impossible or am I doing it wrong? I do think this could be a Studio bug, tell me what you think.
EDIT: this seems to be a bug only with strings as it works fine with numbers.
Code Example:
local part = script.Parent
local attribute = part:GetAttribute("SetColour")
while true do
if attribute == "Orange" or "orange" then
part:Destroy()
end
wait()
end
this is some random code but is a good example of what i mean
i did a print before and it gave me the right string, but the If statement did not detect the string, i did this with both right and wrong strings and it seems as the If statement is the broken one as it works fine for wait(Attribute) when i put in a number value.
local part = script.Parent
local attribute = part.Value:GetAttribute("SetColour")
while true do
wait(5)
print(attribute)
if attribute == "Orange" or "orange" then
part:Destroy()
end
end
part was still destroyed, i used a int value which i added a string attribute to.