Need Help With System Type Checking Script

I want to create a system like @wind_o’s CheckMeIn but it seems that my type checking script isn’t working.

(If not type:lower() == 'standard' and 'enterprise' then)

return function(type, allowed)
	if type:lower() == 'enterprise' then
		require(script.Enterprise)(allowed)
		
		end
		if type:lower() == 'standard' then
			require(script.Standard)(allowed)
	end
	
	if not type:lower() == 'standard' and 'enterprise' then
		print('Invalid System Type')
	end
end

not has higher precedence over == so this is what you want:

type = type:lower() -- Instead of calling lower for each case insensitivity comparison just do it once

if type ~= "standard" and type ~= "enterprise" then

end
1 Like

What is ~=? (I’m Curious Lol)

~= is the “not equal to” operator. It is the opposite of ==. You might have seen != in other programming languages. It is that.

1 Like

So it’s basically a short version of, if not?

Kind of. The issue with your script was since not has higher precedence, it evaluated to (not type:lower()) == 'standard' which is the same as false == 'standard' which always evaluates to false. So just remove the not and replace == with ~=.

1 Like