function onSay(player, words, param) local t = param:splitTrimmed(",") if(not t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return false end local tid = Player(t[1]) if(not tid) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return false end local qnt = 1 if(not t[3]) then qnt = 1 else if isNumber(t[3]) then qnt = t[3] else qnt = 1 end end if isNumber(t[2]) then local id = tonumber(t[2]) if _ITEMS[id] then local slot = _ITEMS[id].SLOT_EQUIP local check = 0 for x = 01, _SYSTEM.MAX_BAG_SLOT do if player:getStorageValue(_BACKPACK[slot][00][x].UID_01) <= 0 then if slot == 3 then -- NOT EQUIP tid:setStorageValue(_BACKPACK[slot][00][x].UID_01, tonumber(t[2])) -- ID tid:setStorageValue(_BACKPACK[slot][00][x].UID_02, qnt) -- Qnt tid:setStorageValue(_BACKPACK[slot][00][x].UID_03, math.random(0, 4)) -- Rare tid:setStorageValue(_BACKPACK[slot][00][x].UID_04, math.random(0, 3)) -- Star check = 1 break else tid:setStorageValue(_BACKPACK[slot][00][x].UID_01, tonumber(t[2])) -- ID tid:setStorageValue(_BACKPACK[slot][00][x].UID_02, math.random(0, 4)) -- Rare tid:setStorageValue(_BACKPACK[slot][00][x].UID_03, math.random(0, 3)) -- Star check = 1 break end end end if check == 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua backpack esta cheia.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O player [" .. t[1] .. "] recebeu o item [" .. _ITEMS[id].NAME .. ", x" ..qnt.. "].") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item não encontrado.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end return false end