if dna:WaitForChild(selected.."Owned").Value == true and not dna:WaitForChild("Equipped").Value == selected then
script.Parent.Text = "Equip"
elseif dna:WaitForChild("Equipped").Value == selected.Value then
script.Parent.Text = "Equipped"
elseif dna:WaitForChild(selected.."Owned").Value == false and not dna:WaitForChild("Equipped").Value == selected then
script.Parent.Text = "Buy"
end
while wait() do
selected = script.Parent.Parent.Parent:WaitForChild("ViewportFrame").View.Value
if dna:WaitForChild(selected.."Owned").Value == true and not dna:WaitForChild("Equipped").Value == selected then
script.Parent.Text = "Equip"
elseif dna:WaitForChild("Equipped").Value == selected.Value then
script.Parent.Text = "Equipped"
elseif dna:WaitForChild(selected.."Owned").Value == false and not dna:WaitForChild("Equipped").Value == selected then
script.Parent.Text = "Buy"
end
end
This code doesn’t work for the things called not. How do I even use not. Basicly I want to make it so if dna:WaitForChild(“Equipped”).Value is not equal to selected
While in Python and Ruby not x == y may work because not has lower precedence than == operator, it may not work in Lua because not has a higher precendence than the == operator so the left-hand side is calculator first.
Use the ~= operator to see if it doesn’t equal to something.