Просто, что достаю, теперь что не так?:
function SampEvents.onServerMessage(color, msg)
if msg:find('Вы можете взять') and not sampIsChatInputActive() then
text = msg:match('Вы можете взять %s+(%d+) материалов.')
sampSendChat(string.format('/get guns %d', text)) --- <...