This part: if the shiftkey and not shiftisdown then UserReleasedShiftKey end if should have been: if not the shiftkey and shiftisdown then UserReleasedShiftKey end if