Im trying to figure out if there is any way to compare multiple values to one value using if statements. right now the only way I know how to do this takes a long time and im wondering if i can shorten the amount of code I use.
local comparative = false
local table = {Box1,Box2,Box3,Box4,Box5}
for i = 1,#table do
if(NewBox.Name == table[i].Name)then
comparative = true
end
if(comparative == true)then
print("NewBox is the same as one of the old boxes")
else
print("NewBox is not the same as any of the boxes")
end
Here is the code that I don't know if it works or not.
if(slot.Name == "Box"..{1,2,3,4,5})then
print("slot is an equiping spot")
end

1 comment
Tyvm for accepting! ^^