Exactly what the title says.
This is quite simple actually, just declare key and make a simple if statement determining if the key is correct
local key = (something) if (key == (whatever key is supposed to be)) then --code end